Okay my hosting company has magic_quotes_gpc
turned ON
and I coded my PHP script using stripslashes()
in preparation of this. But now the hosting company says its going to turn magic_quotes_gpc
OFF and I was wondering what will happen now to my data now when stripslashes()
is present should I go through all my millions of lines of code and get rid of stripslashes()
? or leave the stripslashes()
function alone? will leaving the stripslashes()
ruin my data?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
meagar has the correct answer.
But to traverse the situation, you need something like Notepad++ with a Search within files function. Copy a snippet of meagar's code and search for stripslashes()
Your code should use
get_magic_quotes_gpc
to see if magic quotes are enabled, and only strip slashes if they are. You should run a block of code similar to the following in exactly one place, shared by all your scripts; if you're usingstripslashes
in multiple places you're doing it wrong.I would start going through and removing
stripslashes()
. You can do this ahead of time by testing formagic_quotes_gpc
and only callingstripslahes()
if it is needed.