Hello all,

I have a problem that is perhaps a little unusual in our environment. When I edit a page of my site containing a link or image and then edit, and save, the following happens:
The image or the link does not appear!
I return to the page and realize that backslashes were added in all tags.

thus:

Edit the following tags:

<img src="sites/default/files/mapa_google.jpg">
<img src="http://www.drupal-br.org/">
<img src="sites/default/files/pnata2.jpg">

After saving the page, looks like this (note the backslash (\) canceling the tag):

<img src=\"sites/default/files/mapa_google.jpg\">
<img src=\"http://www.drupal-br.org/\">
<img src=\\\"sites/default/files/pnata2.jpg\\\">

Clearly, these tags will not render!
Detail: this is happening on every page of the site!

Some solutions I tried:
1. At first thought to be the theme (used the Touch). Replaced by another and error continued.
2. Once thought to be the browser (use Firefox 10) I went to Chrome and the same thing happening.
3. I reviewed the entire CSS file for errors and nothing.
4. Finally I thought that could only be Drupal, perhaps with some problem in the core. CMS uninstalled completely and reinstalled again. I set up the site and to my surprise, it happened all over again.

I do not know what else to do, the site is stopped and really need your help.
Can you give me some indication of what might be happening with these tags?
What can I do to solve this problem?

I thank you sincerely for those who send me some clue to resolve this bug.

thanks

Hilton

Comments

yelvington’s picture

Read http://drupal.org/node/1437998

Get your hosting company to fix it.

hlbbr’s picture

I read your post and wrote to the server. He replied:

"To fix this issue we recommend either
A) using the latest version of drupal and php 5.3 or
B) if you must use php 5.2.17, magic_quotes_gpc=On needs to be set to =Off in the appropriate php.ini file in order to resolve this issue."

Thank you!

fatima.isa’s picture

For anyone having the same problem, I tried what is mentioned at B and it worked perfectly. Thank you.

hemant_gautam’s picture

For displaying images you can select the input format as PHP Code and provide the path of your image.
If you have kept your images inside images folder under your themes.
So you can write path as follows-

global $theme;
$str_theme = base_path().'sites/all/themes/'.$theme.'';
<img src="echo $str_theme /images/image_name.png" />
fatima.isa’s picture

I'm having the exact problem. My website is hosted online, I have not made any changes on its setup, but suddenly starting 29 April 2012 the problem occurred, whenever I edit and save, an automatic backslash('\') is added to the code before every single(') and double(") quotes, which make the html code don't work.

I have reported this to my hosting company bluehost but their suggestion was to contact drupal!!

jaypan’s picture

Contact me to contract me for D7 -> D10/11 migrations.

hlbbr’s picture

My server is Bluehost too. Please, read my replay above

fatima.isa’s picture

Thank you dear, I tried it and it worked like magic.