mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 02:55:55 +02:00
header.pl: Create new escape function that uses HTML::Entities.
This partly replaces cleanhtml(), which is kept for backwards-compatibility and for a special case.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
package Header;
|
||||
|
||||
use CGI();
|
||||
use HTML::Entities();
|
||||
use Socket;
|
||||
use Time::Local;
|
||||
|
||||
@@ -305,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/&/&/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);
|
||||
}
|
||||
|
||||
sub connectionstatus
|
||||
|
||||
Reference in New Issue
Block a user