BachusII on Aug 17, 2006 at 10:47:52 AM (# 8) This message has been edited.Nazi has a second meaning. That of someone/somepersons being perceived as adhering to some too strict rules way too much. Besides, we were agreeing, not vehementely disagreeing. Jockrock on Aug 17, 2006 at 5:34:11 PM (# 9)I consider myself duly educated! :) MHenke on Aug 18, 2006 at 12:50:16 AM (# 10)> Nazi has a second meaning. That of someone/somepersons being perceived as adhering to some too strict rules way too much. Besides, we were agreeing, not vehementely disagreeing. Which possibly makes me a fool around nazi, then. I hope we don't vehemently disagree that (still) not all of my comments has to be taken serious... 8) cdrom600 on Aug 18, 2006 at 6:13:31 AM (# 11)What? Humor in an online environment! This might clog the Internets' tubes; we'd better get Congress to regulate it ;)
</bad attempt at a joke> bod1467 on Aug 18, 2006 at 9:27:28 AM (# 12) This message has been edited.Any use?
/* Function to strip magic quotes from variables for insertion */ function strip_magic_quotes($arr) { foreach ($arr as $k => $v) { if (is_array($v)) { $arr[$k] = strip_magic_quotes($v); } else { $arr[$k] = stripslashes($v); } }
return $arr; }
if (get_magic_quotes_gpc()) { if (!empty($_GET)) { $_GET = strip_magic_quotes($_GET); } if (!empty($_POST)) { $_POST = strip_magic_quotes($_POST); } if (!empty($_COOKIE)) { $_COOKIE = strip_magic_quotes($_COOKIE); } } /* End of Function to strip magic quotes from variables for insertion */ braveheart on Jan 28, 2007 at 4:01:55 PM (# 13)Switch BOTH of these settings off, as soon as you can; It doesn't matter if they are set globally as you can change them anyways, on a per script issue via ini_set( ... ); for example,
ini_set( 'register_globals', 'off' ); // or ini_set( 'register_globals', false );
You can do so with gpc_magic_quotes as well - put the new settings at the top of your script, or keep them all in the same file, and just INCLUDE them.
The script posted above by Bod will also do the trick, but i (strongly) suggest you go the ini route as well :) Jockrock on Jan 29, 2007 at 3:46:45 AM (# 14)As you have probably surmised by now.... I am a PHP pygmy... I'll learn it one day (honest).
bod1467 yes it is of use - oddly enough for a different project but I have copied and pasted that. Thanks!
braveheart (this thread has a definate Scottish vein) Thanks for the tip. What would be a surefire way of testing the above example?
|