Magic Quotes / Register Globals
From: Paul Schmidinger (my.email.is.on_at_my.website.eigelb.at)
Date: 09/28/04
- Next message: Paul Schmidinger: "Re: Magic Quotes / Register Globals"
- Previous message: cool: "Re: Sessions and closing the browser"
- Next in thread: Paul Schmidinger: "Re: Magic Quotes / Register Globals"
- Reply: Paul Schmidinger: "Re: Magic Quotes / Register Globals"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 28 Sep 2004 09:01:36 +0200
Hi,
I have some software that needs magic quotes and register globals both "on".
I now tried to write a script that simpulates the bevaiour, no matter if
those options are on or off. I would appreciate feedback on the script. I
plan to include the script on all .php-Files of the software.
if (get_magic_quotes_gpc()) $mq=true; else $mq=false;
foreach($_GET as $key=>$value)
if ($mq) eval("\$".$key."=\$value;");
else eval("\$".$key."=addslashes(\$value);");
foreach($_POST as $key=>$value)
if ($mq) eval("\$".$key."=\$value;");
else eval("\$".$key."=addslashes(\$value);");
It appears to be working. Does anyone see any problems with it or possible
improvements ?
What I do *not* want is to start a discussion about wheater magic quotes and
register globals are evil and stuff. :)
Thanks,
Paul Schmidinger
-- www.eigelb.at
- Next message: Paul Schmidinger: "Re: Magic Quotes / Register Globals"
- Previous message: cool: "Re: Sessions and closing the browser"
- Next in thread: Paul Schmidinger: "Re: Magic Quotes / Register Globals"
- Reply: Paul Schmidinger: "Re: Magic Quotes / Register Globals"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|