mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
Merge remote-tracking branch 'ms/xss' into next
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
|
||||
|
||||
@@ -90,7 +90,7 @@ if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
|
||||
$cgiparams{'MONTH'} = $temp[1];
|
||||
$cgiparams{'DAY'} = $temp[2];
|
||||
$cgiparams{'SOURCE_IP'} = $temp[3];
|
||||
$cgiparams{'USERNAME'} = $temp[4];
|
||||
$cgiparams{'USERNAME'} = &Header::escape($temp[4]);
|
||||
}
|
||||
|
||||
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
|
||||
@@ -383,6 +383,7 @@ print <<END
|
||||
END
|
||||
;
|
||||
foreach my $so (sort keys %users) {
|
||||
$so = &Header::escape($so);
|
||||
print "<option value='$so' $selected{'USERNAME'}{$so}>$so</option>\n"; }
|
||||
print <<END
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user