confused about magic quotes

From: Date: Fri, 17 Sep 2004 14:32:27 +0000
Subject: confused about magic quotes
Groups: php.general 
Request: Send a blank email to php-general+get-196980@lists.php.net to get a copy of this message
Hi! I got a problem: The server im running my scripts on has <magic_quotes_gpc=ON>. I know, that i just have to stripslashes() the GPC data. But what if <magic_quotes_sybase> is also set ON? The doc says, that in this case only <'> is replaced by <''>, and nothing happens to <">, <\> and NUL, because <magic_quotes_sybase> overwrites <magic_quotes_gpc> behavior. Unfortunately, the doc says nothing about the case <magic_quotes_gpc=OFF> PLUS <magic_quotes_sybase=ON>. Does in this case nothing happen to GPC data, as <magic_quotes_gpc> is set OFF? Or does it result in the same <'> to <''> replacement, as <magic_quotes_sybase> is set ON? What's <sybase>, anyway? I was about to implement a function as follows: function stripslashes_mq_gpc($txt){ if(get_magic_quotes_gpc()==1){ if(get_ini("magic_quotes_sybase")==1){ $txt=preg_replace("/('')/musi","'",$txt); // rather use str_replace() ?? }else{ $txt=stripslashes($txt); } } return $txt; } The same is to be done for <magic_quotes_runtime>, but there's nothing written about the interaction of <magic_quotes_runtime> and <magic_quotes_sybase>. So, could anyone help me, please? Thanks, Kai aka Christopher-Robin PS: Apologies for my bad english.

« previous php.general (#196980) next »