mirror of
https://gitlab.com/xonotic/xonotic
synced 2025-01-08 23:19:27 +00:00
21 lines
440 B
Diff
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;
|
|
}
|
|
|