1# TODO: turn this into a REAL diff 2# what we did: we added the line with @ stuff 3 4# replace invalid utf8 character with SUBSTITUTION sequence 5sub esc_html { 6 my $str = shift; 7 my %opts = @_; 8 9 return undef unless defined $str; 10 11 $str = to_utf8($str); 12 $str = $cgi->escapeHTML($str); 13 $str =~ s/@/@/g; 14 if ($opts{'-nbsp'}) { 15 $str =~ s/ / /g; 16 } 17 $str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg; 18 return $str; 19} 20 21