Re: Re: Evaluating form posts
| From: | Chris Shiflett | Date: | Mon, 13 Sep 2004 06:44:40 +0000 |
| Subject: | Re: Re: Evaluating form posts | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196483@lists.php.net to get a copy of this message | ||
--- Alexander Kleshchevnikov <seigo@lan23.net.ua> wrote:
> You should chech for configuration of magic quotes gpc.
> Use get_magic_quotes_gpc() function:
>
> $foo = get_magic_quotes_gpc() ? stripslashes($_POST["foo"]) :
> $_POST["foo"]);
I agree. However, stripslashes() doesn't necessarily undo addslashes(). If
you want to know why or see more discussion on that, search the PHP
internals archive. I think it was within the last 3 months or so that this
was discussed.
The best option is to turn that stuff off, but if you can't, I bet the
fix_magic_quotes() function will be helpful. It can be found here:
http://education.nyphp.org/phundamentals/PH_storingretrieving.php
That page also describes why it's best to not use magic_quotes.
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming December 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/