note 87907 added to function.mysql-real-escape-string
| From: | enlaces at exolimpo dot com | Date: | Tue, 30 Dec 2008 04:16:20 +0000 |
| Subject: | note 87907 added to function.mysql-real-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148664@lists.php.net to get a copy of this message | ||
Can someone check this function and tell me how it works? I wanted it to protect from mysql
injections...
you can email me if you think its a good function.. or if you have some thoughts about it.
function safe_input(&$string){
if(is_array($string))
foreach($string as $key => $valor)
$string[$key] = safe_input($valor);
else
$string = trim(
strip_tags(
htmlspecialchars(
addcslashes(
mysql_real_escape_string($string),';%_:$&?-+=*[|]()'
)
,0,'UTF-8')
)
);
----
Server IP: 69.147.83.197
Probable Submitter: 189.148.15.136
----
Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php
Edit -- https://master.php.net/note/edit/87907
Del: integrated -- https://master.php.net/note/delete/87907/integrated
Del: useless -- https://master.php.net/note/delete/87907/useless
Del: bad code -- https://master.php.net/note/delete/87907/bad+code
Del: spam -- https://master.php.net/note/delete/87907/spam
Del: non-english -- https://master.php.net/note/delete/87907/non-english
Del: in docs -- https://master.php.net/note/delete/87907/in+docs
Del: other reasons-- https://master.php.net/note/delete/87907
Reject -- https://master.php.net/note/reject/87907
Search -- https://master.php.net/manage/user-notes.php