FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » magic_quotes_gpc() on or off?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: magic_quotes_gpc() on or off? [message #173884 is a reply to message #173876] Wed, 11 May 2011 14:13 Go to previous messageGo to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 11/05/2011 13:53, Simon escribió/wrote:
>> If $data really comes from GET/POST/COOKIE and the original value is
>> «H\hi», you should have «H\\hi».
>
> So you saying that stripslashes(...) should be called on GET/POST/COOKIE
> rather than on any data?
>
> This certainly makes more sense to me, but the doc is not entirely clear
> about that, or I am just not reading it properly.

Well, yes, of course, that's what the "_gpc" suffix stands for:

«Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When
magic_quotes are on, all ' (single-quote), " (double quote), \
(backslash) and NUL's are escaped with a backslash automatically.»

http://es.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc

It was already bad enough that way :)

>> Inspect its value with var_dump() and make sure it's actually coming
>> from $_GET, $_POST or $_COOKIE.
>>
>> Also, have a look at the register_globals directive. If you rely on it,
>> you can never be sure of where your variable comes from.
>>
>>
>
> Will do, thanks


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: A question about refresh
Next Topic: Program to Submit to forms
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Jul 05 20:03:48 GMT 2024

Total time taken to generate the page: 0.04969 seconds