The move has added several slashes in my content and destroyed it thereby. I have no idea why there are slashes.


title=\"\"><img alt=\"\" class=\"image-large\" src=\"" title="" typeof="foaf:Image" /></a>

I guess this is a broken regex. May be better to use dom_load or just string replace of URLs what should be save, too.


Deciphered’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Unable to replicate. Any information you can provide to reproduce would be extremely helpful.

As for why I use a regex, the old file URL could be in any of the following formats:

Any of them could be in plain text or could be escaped, they could also combine the the path with a image style url.... hence the regex.


v1adimir’s picture

I have the similar issue with Image Insert and File Paths.

Starting from clean Drupal 7 installation I enabled Wysiwig (TinyMCE), Insert, Colorbox and File Paths.

Without File Paths enabled all modules work fine. After File Path enabling I see strange behavior -- when I create node and insert more than one image in paragraph HTML code gets broken.

Before saving (source html withe disabled rich-text in TinyMCE):

<a href="http://d7tests.massha/system/files/styles/large/private/6giyc0kc.jpg" title="" class="colorbox colorbox-insert-image" rel="gallery-all">
<img src="http://d7tests.massha/system/files/styles/medium/private/6giyc0kc.jpg" alt="" title="" class="image-medium">

<a href="http://d7tests.massha/system/files/styles/large/private/6o4vza9g.jpg" title="" class="colorbox colorbox-insert-image" rel="gallery-all">
<img src="http://d7tests.massha/system/files/styles/medium/private/6o4vza9g.jpg" alt="" title="" class="image-medium">

After node is saved:

<a href="http://d7tests.massha/system/files/styles/large/private/test-images/6giyc0kc.jpg\" title=\"\" class=\"colorbox colorbox-insert-image\" rel=\"gallery-all\"><img src=\"http://d7tests.massha/system/files/styles/medium/private/test-images/6giyc0kc.jpg\" alt=\"\" title=\"\" class=\"image-medium\"></a>

<a href=\"http://d7tests.massha/system/files/styles/large/private/test-images/6o4vza9g.jpg" title="" class="colorbox colorbox-insert-image" rel="gallery-all"><img src="http://d7tests.massha/system/files/styles/medium/private/test-images/6o4vza9g.jpg" alt="" title="" class="image-medium"></a>

As you can see there are a lot of backslashes.

And also i have got the warning

Notice: Undefined index: filefield_paths in filefield_paths_filefield_paths_process_file() (line 45 of /opt/www/drupal7/sites/all/modules/filefield_paths/modules/

Do you need additional information?

hass’s picture

This is 100% the same issue.

hass’s picture

Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Active

I may have a repro case as I've expierienced this with a content update. I had an article with wysiwyg enabled and two inserted images of type colorbox large in the content. Than I edited the content again, added some text and uploaded and inserted another new colorbox large image into the content. After I hit save the two previously inserted images disapeared, html was destroyed and the newly upladed image was correctly shown.

Deciphered’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

I can absolutely not reproduce this issue, and based on the description it's not a critical.

If someone can provide me with step by step instructions on how to reproduce the issue I will be happy to fix it.

hass’s picture

My content get's destroyed, images disappear, etc.

Why do you think that this is not critical? We explained several repro cases.

Deciphered’s picture

Hass, the issue might be reproducible for you, but I followed you rough steps as exact as I possibly could and everything worked as expected, so therefore to me the issue is not reproducible.

If you can provide me with more information, such as environment information (PHP version, etc), or do some testing yourself, then I maybe able to help, but I've already put an hour into trying to reproduce this issue and I have been unable to do so.

dman’s picture

Based on the exact timing of the original report and the symptoms described (quotes get backslashed for no good reason)
I'd suggest it may be a really horrid unrelated issue around a server upgrade to PHP that started treating "magic_quotes" differently at one point due to upstream upgrades.

May not be this at all, but it's worth considering - especially as it can't be replicated on other environments. Try a PHP core update maybe?

Deciphered’s picture

Thanks dman, that's definitely some good information and hopefully helps with those experiencing this issue.

dman’s picture

It may not be exactly this and it certainly does smell like an out-of-control regular expression on first blush. Especially if it really can be narrowed down to the enabling or disabling of this one module.
I just recognized the symptoms described here as being similar to something that took us a day to track down this year. And then cropped up subsequently as other OS platforms upgraded over the next months.

Prognosis: many megadeaths. No blame.

hass’s picture

apache/cgi and cli php.ini on my Debian 6 set magic_quotes_gpc = Off explicitly, PHP info also says Off.

gooddesignusa’s picture

I'm having the same issue if I include 2 images in the body of a node using the insert module. It messes up the second image so bad it breaks the html which causes the image to not render. I think its the "_filefield_paths_replace_path" function on line 282 @ that has the regex to update the node body.

As a side note, I've been messing around with the filter_image_secure module to add white-listing and it seems this module uses dom_load like the OP mentioned. For example in filter_image_secure.module line 56 function "filter_html_image_secure_process" uses something like this.

  $html_dom = filter_dom_load($text);
  $images = $html_dom->getElementsByTagName('img');
  foreach ($images as $image) {
   //we could change the image source here with something like $image->setAttribute('src', $new_src);
hass’s picture

Title: Move files cause cluttered content » Add additional files or Move files cause cluttered content
v1adimir’s picture

I can upload to dropbox tgz'ed Drupal installation with described error. Can it help?

hass’s picture

@v1adimir: Have you tried beta4? I gave it a try and I'm currently not able to repro or at least I cannot find the way how it was broken in past. Can you give it a try too and report back, please?

Deciphered’s picture

Version: 7.x-1.0-beta3 » 7.x-1.0-beta4
Status: Postponed (maintainer needs more info) » Fixed

Thanks for the update hass,

While I know we are waiting on additional confirmation, I will mark this issue as fixed based on what you've stated, and if anyone else can still reproduce this issue with 7.x-1.0-beta4 then they can change the issue back to active.

Status: Fixed » Closed (fixed)

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