Jump to content

Switched hosting- now all DB output is addSlashed()


kernelgpf

Recommended Posts

Somehow, after switching hosts, everything that is being taken out of the DB and printed is being "addSlash()"ed, while our previous host automatically "stripslash()"ed everything that was taken out of the DB.

 

Is there anyway to fix this without going through my 50 some odd scripts and "stripslash()"ing everything that's coming out of the DB?

Link to comment
Share on other sites

That means magic quotes was enabled on the old system and is not on the new.  I am not actually sure whether magic quotes run strip slashes as well.  It might, but I always do that myself anyway, whether it does or not.  What you are going to want to do, is disable the magic quotes.  You can "in theory (I have never done it)".  Setup a small script above the page that will "automatically" run strip slashes on everything.  Basically you could run that on the $row variable before using it, and strip slashes can be performed, for example, when you get it.  Well either way you have a long workaround.  Paste a page of code your having problems with, and let's see if we can get you a quick fix solution for all the pages.  (If you can't just enable magic quotes which would be the easiest).  It's always best to "not" use magic quotes, because you run into these kind of problems often when you do.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.