Hello
I am running drupal 7 beta on a shared hosting environment with a multisite setup. I had trouble loading an image which i thought was a wysiwyg issue but they thought it a issue with the filters. I have no disabled all the add on modules (looking for the one that was perhaps triggering the action but have had no luck. What happens is that everytime I save a node I get an additional \ added wherever a word is apostrophized. so building's becomes building\s on first save , building\\'s on second save, building\\\'s of third save etc etc etc. I tried plain text, filtered and html and get the same result , as well as when disabling the filters . I also encountered the problem with images where extra code was added. In the Edit screen I am able to add my image and it displays correctly, but when I press save, the image disappears, with an image placeholder in its place, with a question mark. If I open the image it shows image not found but the image address has additional characters added like this http://www.mysite.co.za/%22/sites/mysite.co.za//files/projects/large_Gav... if I delete both the /%22 my browser takes me to the image. If I insert the image, save it , go back to edit then this is the code I find.
Paul
Comments
Comment #1
Paul M commentedupgraded to 7.0 beta 2 dev have the same behavior
Comment #2
Paul M commentedNot really sure where this issue belongs. Have however managed to get a work around instead of typing ' I type "& r s q u o ; " (the html code-without the spaces as otherwise you just get ') and I get the correct display
Comment #3
Paul M commentedI have moved this to base system as without any additional modules it is still changing the apostrophes and adding \ between them
Comment #4
Paul M commentedOk this problem seems to be the handling of apostrophes in Drupal 7 as I find that this extra \ is added even to menu items and the plain text fields throughout Drupal 7 - I do think this is a serious error so have changed it to critical - I hope that this is the correct procedure but I think it is critical
Comment #5
damien tournoud commentedYou are probably running on a broken PHP environment.
Might be related to those bugs:
PHP 41001.
pecl 10623.
In your case, removing a local
magic_quotes_gpc = 0setting could fix the bug, because in that case we have code to revert the effects of the magic quoting.Comment #6
Paul M commentedOk thanks a lot Damien
I was sure it was something simple but as a non programmer very frustrating !
my drupal report gave php as 5.2.6-1+lenny9
I went to the php admin screen my hosting service gives and turned magic_quotes_gpc to off (it was on on position as set up by the hoster hetzner ) this has solved the problem!!!
Is there a way to add this to the instructions as many novices like myself will struggle with this one!
Comment #7
dman commentedThis problem (or something like it) is now much more likely thanks to a PHP security release of 9 Feb 2012
I've described it in a troubleshooting FAQ - so adding cross-reference here for future searchers.
Comment #8
jahmes8 commentedI fixed the problem by using php.ini to turn off the magic_quotes_gpc function.
magic_quotes_gpc off
the ini file got added by bluehost after the install, and the site was working fine before that. The printout from the link on the status page showing phpinfo() was incorrect.
Comment #9
AimAdvantage commented*** Bluehost and C-panel Shares Server Solution ***
Here's what fixed it for Magic Quotes In Bluehost (with C-Panel) for mine and several clients of mine-
My php_info or php.php page was still showing that all instances of magic quotes were turned off - but it was still not working.
Since there is a server level php.ini file that we don't have access to on Bluehost (and I imagine many other shared server environments)
Step 1 - go in an re-name your php.ini file so that it is temporarily not recognized so the default php.ini file has to be drawn from the main server.
Step 2 - Then recheck your site and even add a page with quotes to see if the slashes disappear.
Step - 3 Then - to re-instate your accessible php.ini file within your C-panel - (having backed up your other file by re-naming it)
Step 4 Go under C-Panel to "PHP config" (in Bluehost this is under "Software Services" in C-Panel)-
Then pick your version of PHP 5.2 or 5.3 and then save it at the bottom -
This will re-install a new php.ini file in the public_html directory and should stop the magic quote issue.
Make sure you back-up before switching versions from 5.2 to 5.3 as some modules may experience issues. . .
Comment #10
fnikola commentedAs Christopher notes here http://drupal.org/node/1437998#comment-5940550 if you do not already have a php.ini file in your Drupal root follow his steps:
- Create a blank text file and add the line:
magic_quotes_gpc = Off
- Save the text file as "php.ini" (without the double quotes)
- Upload the php.ini file to your Drupal root directory.
Thanks Christopher.
Comment #11
monstordh commentedI found that Bluehost had updated the server and modified my configuration for how php.ini works. Rather than allowing local overrides, it reverted to the global php.ini in the root folder, which has magic_quotes_gpc turned on by default (for some reason). All I had to do was turn it off in the root php.ini (and change my memory_limit back to my previous setting) and everything was back to normal.
Comment #12
angelsmit commentedComment #13
angelsmit commentedTo solve this, when entering your text use the Alt + 0180. (Hold the alt key down while typing 0180, then release) It produces the closest appearance to apostrophe.
Comment #14
angelsmit commentedComment #16
avpadernoComment #17
avpaderno