473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

confused about magic quotes

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
0 1099

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marcus | last post by:
Hi all, I've been reading up on magic quotes but I'm still confused, seems like all the info I can find is just regurgitating the little blurb in the php manual. My question is this: if I turn...
1
by: yawnmoth | last post by:
even though register globals is disabled by default, i'm currious as to how it and magic quotes interact. consider the following code: <? // assuming $_GET='"test"' and register globals enabled...
4
by: Dave Moore | last post by:
Hi All, Can anybody point me to a FAQ or similar that describes what all this stuff is about please?. I'm interfacing with a MySQL database if that's relavent. I've read a couple of books which...
31
by: jfj | last post by:
I don't understand. We can take a function and attach it to an object, and then call it as an instance method as long as it has at least one argument: ############# class A: pass def...
9
by: jfj | last post by:
Hi. Suppose this: ######################## def foo (x): print x f = classmethod (foo)
34
by: Richard Hunt | last post by:
I'm sorry for asking such a silly question, but I can't quite get my head around malloc. Using gcc I have always programmed in a lax C/C++ hybrid (which I suppose is actually c++). But I have...
36
by: utab | last post by:
Dear, I have experince in C( numerical projects, like engineering problems, scientific applications) I have the basic notion of C++ also, I have read Accelerated C++ until Chapter 7, however it...
10
by: Jon | last post by:
All, Yes, it's more of the famous 'what do I do about magic_quotes' questions. Anyways, here we go: I've been a PHP developer for about a year now, and have grown to detest magic_quotes for...
3
by: itfetish | last post by:
I've been programming a bit in PHP and then recently learnt classic ASP for projects at work, now I'm working on another project that they want done in .net. I've got my head around web parts, that...
16
by: per9000 | last post by:
Hi, I recently started working a lot more in python than I have done in the past. And I discovered something that totally removed the pretty pink clouds of beautifulness that had surrounded my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.