note 56483 deleted from function.strip-tags by aidan
| From: | aidan@php.net | Date: | Mon, 05 Sep 2005 06:11:08 +0000 |
| Subject: | note 56483 deleted from function.strip-tags by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-94740@lists.php.net to get a copy of this message | ||
Note Submitter: bob at aol dot com
Reason: useless
----
christopher-kunz's example attack is further sterilized by ensuring magic_quotes_gpc is
enabled. nonetheless, xss should be taken seriously.. anther great input filter can be found at http://cyberai.com/inputfilter/
taken from the strip_slashes documentation, this simple function can be used to strip_tags in an
array:
<?php
function strip_tags_in_array($value){
$value = is_array($value) ?
array_map('strip_tags_in_array', $value) :
strip_tags($value);
return $value;
}
?>
Usage:
<?php
$array = array('<p>This paragraph</p>',
'<a href=#"
onclick="alert('alert');">Alert</a>');
$array = strip_tags_in_array($array);
?>
-Ominous Bob