note 110593 added to filter.filters.sanitize
| From: | a3diti at gmail dot com | Date: | Sat, 10 Nov 2012 18:37:58 +0000 |
| Subject: | note 110593 added to filter.filters.sanitize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191852@lists.php.net to get a copy of this message | ||
this cleans it all
function clean($input) {
$input = trim($input); //remove whitespace...
$input = get_magic_quotes_gpc() ? stripslashes($input) : $input; //disable magic quotes...
$input = is_numeric($input) ? intval($input) : mysql_real_escape_string($input); //prevent sql
injection...
$input = htmlspecialchars($input, ENT_QUOTES, 'UTF-8'); //prevent xss...
return $input;
}
----
Server IP: 69.147.83.199
Probable Submitter: 95.107.224.4
----
Manual Page -- http://www.php.net/manual/en/filter.filters.sanitize.php
Edit -- https://master.php.net/note/edit/110593
Del: integrated -- https://master.php.net/note/delete/110593/integrated
Del: useless -- https://master.php.net/note/delete/110593/useless
Del: bad code -- https://master.php.net/note/delete/110593/bad+code
Del: spam -- https://master.php.net/note/delete/110593/spam
Del: non-english -- https://master.php.net/note/delete/110593/non-english
Del: in docs -- https://master.php.net/note/delete/110593/in+docs
Del: other reasons-- https://master.php.net/note/delete/110593
Reject -- https://master.php.net/note/reject/110593
Search -- https://master.php.net/manage/user-notes.php