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

Paul M’s picture

Component: base system » filter.module

upgraded to 7.0 beta 2 dev have the same behavior

Paul M’s picture

Component: filter.module » base system

Not 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

Paul M’s picture

Version: 7.0-beta1 » 7.0-beta2
Component: filter.module » base system

I have moved this to base system as without any additional modules it is still changing the apostrophes and adding \ between them

Paul M’s picture

Title: additional code added on node save » apostrophe not handled correctly on node save
Priority: Normal » Critical

Ok 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

damien tournoud’s picture

Category: bug » support
Status: Active » Closed (won't fix)

You 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 = 0 setting could fix the bug, because in that case we have code to revert the effects of the magic quoting.

Paul M’s picture

Ok 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!

dman’s picture

This 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.

jahmes8’s picture

I 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.

AimAdvantage’s picture

*** 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. . .

fnikola’s picture

As 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.

monstordh’s picture

I 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.

angelsmit’s picture

angelsmit’s picture

Issue summary: View changes

To 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.

angelsmit’s picture

Status: Closed (won't fix) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avpaderno’s picture

Version: 7.0-beta2 » 10.0.x-dev
Priority: Critical » Normal
avpaderno’s picture

Version: 10.0.x-dev » 7.x-dev