Re: cvs: phpdoc /en/reference/mysql/functions mysql-real-escape-string.xml
| From: | Hannes Magnusson | Date: | Sun, 17 May 2009 14:02:53 +0000 |
| Subject: | Re: cvs: phpdoc /en/reference/mysql/functions mysql-real-escape-string.xml | ||
| References: | 1 2 3 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-4029@lists.php.net to get a copy of this message | ||
On Sat, May 16, 2009 at 19:10, Aidan Lister <aidan@php.net> wrote:
> 4. The magic quotes check highlights an interesting problem but
> doesn't discuss it. A cleaner and more reusable approach would be
> pre-processing the whole POST array. That way huge amounts of code
> won't need to be modified in PHP6 (when get_magic_quotes_gpc is gone).
> Although it's not as much of a problem now, the whole issue should
> probably be discussed on that page.
That is the whole point of the example, to showcase how to escape
_correctly_ taking all possible fuckedup configurations into account.
The preceding connecting and stuff is just to have a standalone example.
And get_magic_quotes_gpc() is not gone in PHP6, I fought hard to keep
it there as it is the only way to write best practice code in PHP5 and
still be PHP6 compatible.
> Do you disagree, or are you highlighting the need for more informative
> CVS messages? :)
Well, your arguments are fine, and the example probably could be
better, but the things you comment on are just fillers. The point is
to use $link with mysql_real_escape_string(), check for MQ and cast
the arguments correctly.
-Hannes