By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,713 Members | 1,369 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,713 IT Pros & Developers. It's quick & easy.

confused about magic quotes

P: n/a
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.
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.