note 84636 added to function.mysql-real-escape-string

From: Date: Wed, 23 Jul 2008 04:44:48 +0000
Subject: note 84636 added to function.mysql-real-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-142585@lists.php.net to get a copy of this message
No, your approach is bad, for a couple reasons: 1) Passwords such as "<MyPASS$<>" would be removed by strip_tags(). 2) You're not considering the whole get_magic_quotes_gpc(). If that's enabled, your routine takes user input such as "o'reilly" and returns "o\'reilly". So if a user types o'reilly and that gets inserted into the DB as someone's last name, it shows up in the DB as o\'reilly. Not good. ---- Server IP: 69.147.83.197 Probable Submitter: 71.201.254.169 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php Edit -- https://master.php.net/note/edit/84636 Del: integrated -- https://master.php.net/note/delete/84636/integrated Del: useless -- https://master.php.net/note/delete/84636/useless Del: bad code -- https://master.php.net/note/delete/84636/bad+code Del: spam -- https://master.php.net/note/delete/84636/spam Del: non-english -- https://master.php.net/note/delete/84636/non-english Del: in docs -- https://master.php.net/note/delete/84636/in+docs Del: other reasons-- https://master.php.net/note/delete/84636 Reject -- https://master.php.net/note/reject/84636 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#142585) next »