]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/cfgroot/header.pl
header.pl: Create new escape function that uses HTML::Entities.
[people/teissler/ipfire-2.x.git] / config / cfgroot / header.pl
index 91b54fc3879191e2df587231ae3080ad6c482fc4..9129c682c05f0d20be9798eee502fac7e61848fd 100644 (file)
@@ -12,6 +12,7 @@
 package Header;
 
 use CGI();
+use HTML::Entities();
 use Socket;
 use Time::Local;
 
@@ -157,13 +158,17 @@ sub genmenu {
     if ( $ethsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $ethsettings{'RED_TYPE'} eq 'STATIC' ) {
        $menu->{'03.network'}{'subMenu'}->{'70.aliases'}{'enabled'} = 1;
     }
+
+    if (&General::RedIsWireless()) {
+        $menu->{'01.system'}{'subMenu'}->{'21.wlan'}{'enabled'} = 1;
+    }
 }
 
 sub showhttpheaders
 {
        print "Cache-control: private\n";
        print "Connection: close\n";
-       print "Content-type: text/html\n\n";
+       print "Content-type: text/html; charset=UTF-8\n\n";
 }
 
 sub is_menu_visible($) {
@@ -301,16 +306,16 @@ sub IpInSubnet
     return (($ip >= $start) && ($ip <= $end));
 }
 
-sub cleanhtml
-{
+sub escape($) {
+       my $s = shift;
+       return HTML::Entities::encode_entities($s);
+}
+
+sub cleanhtml {
        my $outstring =$_[0];
        $outstring =~ tr/,/ / if not defined $_[1] or $_[1] ne 'y';
-       $outstring =~ s/&/&amp;/g;
-       $outstring =~ s/\'/&#039;/g;
-       $outstring =~ s/\"/&quot;/g; #" This is just a workaround for the syntax highlighter
-       $outstring =~ s/</&lt;/g;
-       $outstring =~ s/>/&gt;/g;
-       return $outstring;
+
+       return escape($outstring);
 }
 
 sub connectionstatus