note 73605 added to function.addslashes
| From: | AdrianC at osu1 dot php dot net | Date: | Sat, 03 Mar 2007 02:06:08 +0000 |
| Subject: | note 73605 added to function.addslashes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124036@lists.php.net to get a copy of this message | ||
What happends when you add addslashes(addslashes($str))? This is not a good thing and it may be
fixed:
function checkaddslashes($str){
if(strpos(str_replace("\'","","
$str"),"'")!=false)
return addslashes($str);
else
return $str;
}
checkaddslashes("aa'bb"); => aa\'bb
checkaddslashes("aa\'bb"); => aa\'bb
checkaddslashes("\'"); => \'
checkaddslashes("'"); => \'
Hope this will help you
----
Server IP: 69.147.83.197
Probable Submitter: 193.17.70.26 (proxied: 194.42.100.123)
----
Manual Page -- http://www.php.net/manual/en/function.addslashes.php
Edit -- https://master.php.net/note/edit/73605
Del: integrated -- https://master.php.net/note/delete/73605/integrated
Del: useless -- https://master.php.net/note/delete/73605/useless
Del: bad code -- https://master.php.net/note/delete/73605/bad+code
Del: spam -- https://master.php.net/note/delete/73605/spam
Del: non-english -- https://master.php.net/note/delete/73605/non-english
Del: in docs -- https://master.php.net/note/delete/73605/in+docs
Del: other reasons-- https://master.php.net/note/delete/73605
Reject -- https://master.php.net/note/reject/73605
Search -- https://master.php.net/manage/user-notes.php