Re: magic quotes
| From: | Philip Olson | Date: | Thu, 03 Apr 2003 07:43:15 +0000 |
| Subject: | Re: magic quotes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142085@lists.php.net to get a copy of this message | ||
On Thu, 3 Apr 2003, Justin French wrote:
> Hi all,
>
> Can I just have a quick head check on magic quotes runtime (&gpc)?
>
> I have them both set to Off currently, and my pages work fine. However,
> when I set them to on, I end up with slashes throughout the mysql data.
This means you essentially ran addslashes() twice before
insertion. Don't do that. You should never ever have to
strip slashes from data already in the database.
> Is this the expected behaviour? Seems counter-intuitive to me, but I've
> never really cared about it 'till today, because i've never had a problem!!
No, only add slashes once. Do this with a function like
addslashes() OR do it magically. Once.
> What is a common setting for these two directives, so that I can have my LAN
> server *reasonably* "normal".
Defaults to on so I guess that's "normal". See also
get_magic_quotes_gpc()...
Regards,
Philip