in reply to Preventing XSS
Sounds to me like you want
$vars{$_} = HTML::Entities::encode_entities($vars{$_}, '<>&"');
Quote HTML::Entities,
The default set of characters to encode are control chars, high-bit chars, and the <, &, >, ' and " characters. But this, for example, would encode just the <, &, > and " characters:
$encoded = encode_entities($input, '<>&"');
It converts plain text into tag-less HTML.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Preventing XSS (sg)
by tye (Sage) on Sep 19, 2007 at 20:48 UTC |