| |||||||
|
|
Click here to download plain text source code.
# subroutine name: safe_tag # HTML-encodes string (prepare data for HTML output) # Replaces: # & -> & # < -> < # > -> > # " -> " # \x0D -> remove sub safe_tag { my ($input) = @_; $input =~ s/&/&/sg; $input =~ s/\</</sg; $input =~ s/\>/>/sg; $input =~ s/\"/"/sg; $input =~ s/\x0D//sg; $input=~s/([\x01-\x08\x0B-\x1F])/"".ord($1).";"/esg; $input; } |
|||||||||||||||||||||
| Copyright © 1999-2007 Atomicsoft Ltd. All Rights Reserved. | ||