I'd post this on a module - but I'm really not sure which one to post it on. So if I may, I'll throw myself on the mercy of those present and seek their advice as which rabbit hole to run down.

I'm using WYSIWYG and CKEditor for edit purposes. The day before yesterday, all was fine. Today I reied to post a new Book page (though something similar happens with simple pages). The page save appears to insert rogue back slashes in the saved text. For instance:

***** BEGIN ****
What can I say about Jack? He's really not a nice man. But sometimes - really not nice is just the kind you need.

JACK SHADOW doesn't have a contract yet - and the cover is a concept design only.
***** END *****

Turns into:

***** BEGIN ****
What can I say about Jack? He\'s really not a nice man. But sometimes - really not nice is just the kind you need.

JACK SHADOW doesn\'t have a contract yet - and the cover is a concept design only.
***** END *****

Trying to add an image (via KCFinder) is even more evil. The link text is scrambled entirely.

Might any have any thoughts? I have added Content Access and Forum Access recently, but I added them and added new Book pages after adding them without apparent issue.

Comments

Graeme Smith’s picture

Yes, Search really is my friend. I just have to remember to work harder at how I construct what I'm looking for...

It was magic_quotes_gpc set to On in php.ini. Modified to Off, no issue.

---
The Idiot
or
Jack's shadow
or
Charlie's Driver

transformative’s picture

Thanks for posting your solution here.
I'd seen another reference to magic quotes, but not on as similar an issue.
The same thing happened to one of our sites yesterday as well.
Images stopped appearing when a node was saved, and WYSIWYG stopped working, because special characters were getting escaped every time a page was saved. After saving a page a number of times, we would get something that looked like this:
img src=\\\\\\"

We hadn't changed the php.ini file since March, and hadn't been working on the site when this started happening.

I wondered whether the host (BlueHost, in this case) upgraded the version of PHP and, since magic quotes are now deprecated (http://php.net/manual/en/security.magicquotes.php), they stopped working. I haven't looked into it further yet, though. The timing does seem to coincide with yours, so I was curious whether yours could have been a result of a server upgrade as well. Update: It doesn't look like it's a big PHP version upgrade or anything, so I'm not sure what might have happened to make magic quotes start behaving like that all of a sudden.

Anthony Pero’s picture

THIS IS IT. Hostmonster and BluHost are the same company. I've been on the phone with them all day. This is my problem as well.

Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/

piraxter’s picture

My hosting is bluehost and five days ago send me a email because the bluehost servers is upgrading to CentOS 6. Now i cant post images or URL.

PoolBum’s picture

I also have HostMonster and I am having the same problem with back slashes appearing after text is saved with an apostrophe or quotes (e.g.: Mary's always becomes Mary\'s), all links (e.g. src="http:// becomes src=\"http://). If I save multiple times I get a bunch of back slashes (e.g. Mary\\\\\\\'s). I would love to not have to reinvent the wheel and I've already been at it for hours. Can you tell me what you found out with HostMonster?

Thanks

Macar-1’s picture

Having the same problem at Bluehost.
No link updates will work because
<a href="http://www.site/example.pdf">example</a>
Results in a link that leads to:
http://www.site.org/%5C%22http://www.site.org/example.pdf%5C%22
Thanks for bringing it up here though cause I was going crazy looking for a cause

piraxter’s picture

Edit the php.ini file in your bluehost account, and put magic quotes Off

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
Macar-1’s picture

Thank you so much all problems resolved for me

bizwiseconsulting’s picture

How do I go about getting access to change the php.ini file within BlueHost?

piraxter’s picture

Its in your root directory from bluehost account.

Connect to account using a FTP client.

bizwiseconsulting’s picture

I connected via FTP and I still see no file called php.ini. Any suggestions?

piraxter’s picture

Well, I edit the php.ini file from my root (public_html) account where is my main drupal installation, but it not works for another installations as:

public_html/firstdrupal_installation <----works

public_html/another/secondrupal_install <---doesnt work :(

So, copy the same php.ini file to /another folder and work, but I dont know if is wright.

¿Its ok?

Thanks

skelleyh’s picture

I'm having the same problem with my 7.12 install on Bluehost. My issue is occurring on a subdomain, for which I do not see a php.ini file. I do see one at the root level, though I'm not having problems there--and there is a 6.24 Drupal install in the root. Should there be a php.ini in the subdomain also? If I change the one in the root am I going to screw up my other subdomain Drupal installs?

Thanks for your insight on this. Two hours of cell minutes lost to Bluehost trying to figure this out this afternoon.

piraxter’s picture

I copy the same php.ini to subdomain and work, but I dont know if this is ok or give me problems later..

piraxter’s picture

To use the same php.ini file in all subdomains go to:

In your cpanel's software / services section, set your account to single php.ini.

PHP 5.2 (Single php.ini)
Same as PHP 5.2, but all subdirectories will use ~/public_html/php.ini

That's all folks :)

Warning: When you choose to use the single php.ini file, bluehost replace the file, be careful to edit again.

craujax’s picture

I spent the last 30 hours going insane over the issue specially because I edited the magic quotes to off. The single php.ini did it!!!

Thank you!!!
Claudia

Anthony Pero’s picture

This is exactly right. Your server is set up that each directory with scripts needs its own php.ini

Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/

WAFishAman’s picture

:-)

Louis_Trapani’s picture

I was going crazy with this issue tonight trying to figure out what was causing it and how to remedy it. I maintain two Drupal sites (two different servers, but with the same hosting service). Editing the php.ini fixed the problem. I need to do it on my other site now, but I had to thank you first for the solution.

transformative’s picture

[Oops, I didn't reload the page, to see that others had replied with specific details, before making this comment. Anyway, here was another description of what to do:]

Did you try turning magic quotes off, to fix it, as per this post: http://drupal.org/node/1549800#comment-5926402 ?
That worked for me... and for other people, from the sounds of it.

Have a look in the root directory of your site for a php.ini file.
Search for magic_quotes in the file, and change magic quotes from On to Off, so that it now looks like this:

magic_quotes_gpc	=	Off

If the php.ini file isn't present in your the root directory of your site, you might need to create one. Or use cPanel: http://drupal.org/node/1549800#comment-5929380.

I don't know if this addresses the issue you're having, but I wanted to provide explicit instructions in case that helps you or anyone else.

---
Perhaps someone else has more details about what changes, specifically, were made by BlueHost and HostMonster. Ah, it sounds like they upgraded to CentOS 6: http://drupal.org/node/1549800#comment-5928886.

KRM’s picture

Plus one for having issues with this today on BlueHost. Editing the php.ini in the root dir did fix the issue.

For those of you that do not see the php.ini, you may need to go to C Panel first and choose "PHP Config". Then choose the "PHP 5.2 (Single php.ini)" and save changes.

Now SSH into your account and you should see a php.ini file in the root of your account. Edit that file and all subdomains will be fixed as well (at least they were for me).

This reminds me that i need to switch to a dedicated server...

I have used BlueHost for four years with absolutely no problems and now in 2012 i've had issue galore.

skelleyh’s picture

Same. I've used BlueHost for years and never had a problem. This year I've spent hours on the phone with them.
Thanks for all the info on this. Bluehost was NO help at all in isolating what the problem was, or in fixing it.
You guys are awesome.

piquef’s picture

THANK YOU for this explicit advice - that was exactly what I needed to know to make the appropriate change to php.ini, when I could not find it originally. THANKS too to those who have explained just what I needed to change in the php.ini file. This was a very time-consuming and frustrating episode in my Drupal work.

Anthony Pero’s picture

I have been with Hostmonster for all of my shared hosting sites since 2006. This is the first problem I've had with support--ever. (BlueHost and Hostmonster share the same infrastructure and support team)

When I called them at 12:00 EST, they had no idea what the problem was, and told me it was a Drupal problem, even though I had specified that I had confirmed this was an issue across multiple codebases and even multiple accounts that didn't exist previously in the day, and I had changed nothing. Then they basically dumped me off the phone with a "not our problem." It was massively annoying.

In fact, I didn't start getting any traction on this issue until I ranted about it on Twitter. Which I've never done about anything before. Of course, Drupal's wonderful community solved the problem and I was up and running again... 6 hours before I received an email telling me how to fix the problem from Hostmonster. This was 4 hrs after I called them to tell them what the problem was, and how to fix it. Ugh.

I've always felt that I was getting more than I paid for with Hostmonster, because the US-based support team has been awesome, and always gone far beyond their mandate to help me with issues that were generally my fault.

Today I felt like I got exactly what I paid for.

Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/

jhood’s picture

Thank you for sharing your detailed account here. I contacted bluehost chat support about 3pm EST and was similarly blown off.

Here is a copy of part of my transcript:

[1:15:04 PM] Both started having the issue about 1:45pm eastern time
Jean L: [1:15:07 PM] Thanks. taking a look.
John: [1:15:17 PM] Thanks :)
Jean L: [1:17:25 PM] No other reports have come in with this, however this looks like script related.
[1:17:45 PM] I've asked a senior member and he said its a script issue not a server issue.
John: [1:20:10 PM] ok, I will keep searching then. I'm quite perplexed since this started happening on two separate websites on two separate hosting accounts when I was only working on one of the accounts.
[1:20:23 PM] thanks for your hel
[1:20:23 PM] help
Jean L: [1:22:29 PM] I'm really not sure why that would be the case but i had the senior member check and he guarantees me nothing has changed server wise.

I've had few issues over the years, but they have always been right on top of the issue. Maybe it is time to start paying more for better support :-/

trentharlem’s picture

Thank you! This works!

I was able to fix this with NO CALL to my host (Hostmonster) by uploading a php.ini file to my public_html directory (with magic quotes turned Off).

dman’s picture

This was a regression that came out with a particular release of PHP. I documented it here.

Submitted content ends up with garbage quotes and backslashes : \"\\ "\\\\ etc. A magic_quotes_gpc issue

Can anyone post the exact PHP version & date that you are seeing this on? It should have been fixed upstream in the update released here
http://people.canonical.com/~ubuntu-security/cve/2012/CVE-2012-0831.html

Anthony Pero’s picture

On my Hostmonster - PHP Version 5.2.17

They offer PHP 5.3, but I still run several Drupal 6 sites with modules that would not run correctly on 5.3.

If you want, I will link you to my phpinfo() file privately.

Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/

myk.robinson’s picture

thank you to everyone who posted. My site(s) are on Hostmonster as well, and the magic quotes trick worked for me as well.

can't say thank you enough.

odyseg’s picture

were mos of my contemplate files are affected. Luckily I stumble on this page and had the solution applied. thanks guys for sharing.

jhalicea’s picture

Six years with Bluehost and Never had a problem with them until now... Thanks you guys for the quick help. I'm wondering how do you realized how to fix the problem????

Anthony Pero’s picture

It was very similar to a problem another developer had encountered on his dev server when that php security update was first rolled out. He had documented the problems on here, and someone who first had the problem with BlueHost/Hostmonster linked us to the article.

Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/

Christopher James Francis Rodgers’s picture

See page

Submitted content ends up with garbage quotes and backslashes : \"\\ "\\\\ etc. A magic_quotes_gpc issue
http://drupal.org/node/1437998


All the best; intended.
-Chris (great-grandpa.com)
___
"The number one stated objective for Drupal is improving usability." ~Dries Buytaert *

Anthony Pero’s picture

Ok, I finally received an email from someone with a little more authority at Hostmonster. In all fairness, I thought I would post their response here. I'm still probably going to get a better (more expensive) host as soon as I am able to, but I wanted to make sure to say that prior to this episode, I received fantastic support from Hostmonster, considering they are a low-budget shared hosting platform. I just can't afford to have something like this happen again. I'm at the stage in my business where I need a VPN at minimum, where I control the upgrades. Here is the response I received today, after many, many blunders along the way:

Here is the first email I sent to Hostmonster, this was after an extremely unsatisfactory call to tech support, and several rants on twitter, which finally got their attention and response. I was asked to please submit a detailed support request through the interface, so they could track it better than a phone call:

Today I received a call from a friend, asking for help with his Drupal 6 site (premiereventconcepts.net). He had been updating content (which has been done at least four times in the past week). He had saved updates four or five times in the previous minutes. At 11:44 EST (according to his log file) he saved it again, and all of his apostrophes were being escaped, like this: That\'s Not Right.

He tried to delete the apostrophes, but they showed back up. He deleted the content entirely, then recreated it with a different title, same problem. He tried to update a different piece of content. Same result. When the data is being written to the database, the \ is being put in. He called me, I verified these steps for him, then proceeded to check a Drupal 7 site on the same server. Same result. I had been working on that site earlier in the day, and it wasn't happening then. I then proceeded to check another project of mine on a DIFFERENT account (fouronefourproductions.com), which is running Drupal 7.12, and I just built last week. I had updated content earlier today with no issues, and have not run any updates or downloaded any new code since Monday. It has the same problem. Every time I update or create content (CRUD functions), the apostrophes are escaped. I realized at this point that it was time to call support. I called support, was put on hold for 10 minutes, and when the person came back, I was told that nothing had been updated and it was a Drupal issue.

Here's the problem with that. At 11:34 EST, content was being updated on two different hostmonster accounts (not just two websites, but two accounts) that are running two DIFFERENT versions of Drupal. One is the latest version, one is not. There were no issues. At 11:44 EST, \ started showing up on two different hostmonster accounts, even though no code updates or other back-end changes had been made. Only content added to the MySQL database. That's it. I don't see how it could possibly be a "drupal" issue when something works perfectly, is not changed, and ten minutes later it no longer does, across multiple hostmonster accounts. I explained this all to your support person and was brushed off.

I would have totally understood the response "I can't find anything wrong right now, but I've notified my superiors and we are looking into it." The response: "We didn't make any changes so it must be a drupal issue" after receiving EXACLTY the same explanation I've just given in this email, right down to "the code base has not changed" and "two separate accounts are affected" (I've confirmed a third since then.)

Overall, I've been extremely happy with Hostmonster Support, especially considering you are a lower-end shared hosting company. That's why I've had an account with you since 2007. That's why I've set up 19 clients on hostmonster servers. I wasn't expecting the problem to be fixed over the phone call, considering the problem just happened 20 minutes before, but I wasn't expecting to be told "it's a Drupal problem" either. Especially when I had gone through the confirmation I had prior to the phone call. Assuming your clients are idiots is bad enough. Communicating that to them this way is just really bad for customer support.

Later in the afternoon, after finding the solution here, I called Hostmonster back and told them again what had happened, and how to fix it. I also asked them to cancel my support request, they said they would.

Later that evening, I received the following email:

I apologize for the trouble you've been having.

I have done a little testing and found that this is being caused by a setting called "magic quotes gpc" which can be enabled/disabled using the php.ini file.

Try changing

magic_quotes_gpc = On

to

magic_quotes_gpc = Off

in your public_html/php.ini file and let me know if this solves the problem for you.

I laughed a little and emailed them back:

This was the issue. I talked to about 30 other blue host and hostmonster customers using Drupal who had the same issue online. We had come up with that as well. Any idea why that happened?

Tech Support's response:

Hello,

It seems to have something to do with the way Drupal is handling escapes however its not something that was caused by Hostmonster.

Which set me over the edge:

Really? Wow. So you are saying that on Friday morning, when everything worked perfectly, even though I didn't change anything in the Drupal codebase at all, didn't update anything, didn't add anything, somehow, magically, my codebase changed? Because if you didn't change settings, run an update, or something, then that means Drupal employs magic fairies that arbitrarily change code bases.

This response you just gave me here has cemented the fact that I will be looking for another host provider.

Also, please see this information regarding why the issue belongs to a php release: http://drupal.org/node/1437998

And this issue, where it was fixed: http://people.canonical.com/~ubuntu-security/cve/2012/CVE-2012-0831.html

I have also found reports that this issue is not isolated to Ubuntu php.

The point is, no one thinks you guys did anything WRONG... but the issue was absolutely CAUSED by some upgrade you did. It may be a problem with Drupal, but If its working one minute, and nothing is changed, and not working the next, and this is confirmed across multiple accounts, installations, and over 40 users... why in the world would you try to claim that nothing you did caused it? It makes you look stupid. No one wants stupid tech support.

Finally, I got the following response from them:

I can't apologize enough for this situation that has occurred here. YES there was an UPGRADE done on OUR END. We did a bunch of upgrades and changes to PHP 5.2.17 and PHP 5.3.10

http://code.google.com/p/php52-backports/

as a reference as to part of what we did on our centOS 6 servers.

I have yet to get the admin responsible for the upgrades to confirm exactly how this would have affected sites post-upgrade for those who had or didn't have magic_quotes_gpc set to off. (as he was not in at the time of this ticket response)

That being said, I am sorry that our front line of support failed you in the support that we offered you.

What I can say is...this has been brought to the attention of our supervisors and those responsible for disseminating information out to us, so things like this don't occur in the future.

Unfortunately I am unable to make guarantee's in said support, and in the future, if you find you are getting pushback from our level 1 techs, maybe have them either transfer you to a L2 scripting tech (If this is a call in) or move the ticket to the L2 scripting queue. Or our L3 techs.

They usually have the most up to date information on what has been upgraded, changed, etc... that could possibly be affecting your site.

I know this more then likely doesn't repair the relationship between us. I just didn't want you to think that all support here had gone downhill and degraded, if you are still resolved in leaving us.

Despite our hangups and our growing pains, I still feel we are a better shared hosting company then most other offerings.

We are always trying to improve and fix our issues. Even though it may not appear that way.

As far as the last two paragraphs of that email go, I agree. I do think Hostmonster provides great support for a shared host. But it doesn't matter. I need better. I was told by four, count them FOUR different people in Tech Support that NO changes had been made to any of my three servers, in spite of any reasonable argument to the contrary. At least two of them checked with superiors while I was on the phone. One left me on hold for 15 minutes, then came back and told me that it was a Drupal problem, nothing they had done. This was after he had spent 10 minutes on the phone with me convinced it was a MySQL problem. I know very little about servers, or coding, and I knew (it was the first question out of my mouth) that this had been caused by a php upgrade. Its the only thing that made sense. The fact that, basically, this tech had a superior tell him to say that to me is just... severely disrespectful.

So, if you have non mission-critical sites that are perfect for Shared Hosting, for the most part Hostmonster is a great place for you to be. If your site can't afford this kind of thing... You shouldn't be on shared hosting anyway. I've learned my lesson.

Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/

dman’s picture

Thanks for the follow-up. Long as it may be, it's fair.

It's fantastic you had such a small time-window to narrow it down to. When I first found this issue a few months ago on our dedicated-managed hosting plan (not Bluehost) months ago it was noticed a few days later, and it was tricky to make the connection.

My take-away is that at least someone did finally 'fess up.
The rest of it you can just put down to ignorance, not malice.

I can imagine that a good number of level one support calls from their 'level 1' sort of clients are "you broke my site" when it really is scripting issues.
Getting the run-around when you were able to provide them with such detailed specifics - especially after you did the research yourself and found the actual fix and proof is certainly frustrating. I'm astonished they didn't get a rash of similar tickets raised - I've seen at least 30 cases and reports here on d.o alone this week - and think that something really was up sooner.

Anyway. I would put this down to some tech not sending a notification down the line or ... more likely ... the front-line guys just not reading such notifications. Maybe it was only flagged as minor.

I say this, because, although it gave me a lost half-day when I first found it I shook my fist in the air but not at the automatic script that applied 'minor', 'security' patches to our managed server.

I had to work all the way back from (nothing's changed, what browser are they using, has there been a version update, didn't we update the wysiwyg editor library recently, can we replicate on the -dev site, can THEY replicate on the dev site, WTF, it smells like magic_quotes, but that's always been off - hasn't it, what has changed recently, inspect the php.ini for changes, ask the hosting guys - something was flagged as a minor security patch so was applied silently and automatically, hm, experiment, replicate, don't believe it, research, headdesk)

Like I say, it was tagged as an important security patch. It was probably tagged as a very minor notification level. Updates like these can happen several times a month if you are really following best-practice on security updates. Even if you are watching the memos, information like this gets missed.

Anthony Pero’s picture

I had to get the thing up and running. My friend was expecting about 50-100 orders for a one off product that evening, and had no way to insert a pay pal button into the site. Hence my utter lack of patience with the whole thing. But, thanks to the Drupal.org community, I got everything figured out in about 4 hours.

As far as them not getting a rash of support calls... pretty sure they did. I've never waited more than 2 minutes for them to answer the call before. I waited 17 for my evening phone call. The first phone call, I got through in 30 seconds. As I said, the support is usually outstanding. I'm assuming the issue was that they actually didn't have any clue that an upgrade had occurred.

Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/