xonotic/misc/infrastructure/mirror/gitweb.cgi.patch
2010-11-20 18:38:59 +01:00

21 lines
440 B
Diff

# TODO: turn this into a REAL diff
# what we did: we added the line with @ stuff
# replace invalid utf8 character with SUBSTITUTION sequence
sub esc_html {
my $str = shift;
my %opts = @_;
return undef unless defined $str;
$str = to_utf8($str);
$str = $cgi->escapeHTML($str);
$str =~ s/@/@/g;
if ($opts{'-nbsp'}) {
$str =~ s/ / /g;
}
$str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg;
return $str;
}