This partly replaces cleanhtml(), which is kept for
backwards-compatibility and for a special case.
package Header;
use CGI();
package Header;
use CGI();
use Socket;
use Time::Local;
use Socket;
use Time::Local;
return (($ip >= $start) && ($ip <= $end));
}
return (($ip >= $start) && ($ip <= $end));
}
+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';
my $outstring =$_[0];
$outstring =~ tr/,/ / if not defined $_[1] or $_[1] ne 'y';
- $outstring =~ s/&/&/g;
- $outstring =~ s/\'/'/g;
- $outstring =~ s/\"/"/g; #" This is just a workaround for the syntax highlighter
- $outstring =~ s/</</g;
- $outstring =~ s/>/>/g;
- return $outstring;
+
+ return escape($outstring);