Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The move has added several slashes in my content and destroyed it thereby. I have no idea why there are slashes.
Example:
title=\"\"><img alt=\"\" class=\"image-large\" src=\"http://example.com/files/styles/large/public/nodes/story/44/foo.png" 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.
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commentedUnable 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:
public://file.ext
private://file.ext
/sites/all/files/file.ext
http://www.site.com/sites/all/files/file.ext
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.
Cheers,
Deciphered.
Comment #2
v1adimir CreditAttribution: v1adimir commentedI 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):
After node is saved:
As you can see there are a lot of backslashes.
And also i have got the warning
Do you need additional information?
Comment #3
hass CreditAttribution: hass commentedThis is 100% the same issue.
Comment #4
hass CreditAttribution: hass commentedI 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.
Comment #5
Deciphered CreditAttribution: Deciphered commentedI 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.
Comment #6
hass CreditAttribution: hass commentedMy content get's destroyed, images disappear, etc.
Why do you think that this is not critical? We explained several repro cases.
Comment #7
Deciphered CreditAttribution: Deciphered commentedHass, 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.
Comment #8
dman CreditAttribution: dman commentedBased 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 http://drupal.org/node/1437998 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?
Comment #9
Deciphered CreditAttribution: Deciphered commentedThanks dman, that's definitely some good information and hopefully helps with those experiencing this issue.
Comment #10
dman CreditAttribution: dman commentedIt 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.
Comment #11
hass CreditAttribution: hass commentedapache/cgi and cli php.ini on my Debian 6 set
magic_quotes_gpc = Off
explicitly, PHP info also saysOff
.Comment #12
gooddesignusa CreditAttribution: gooddesignusa commentedI'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 @ http://drupalcode.org/project/filefield_paths.git/blob/refs/heads/7.x-1.... 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.
Comment #13
hass CreditAttribution: hass commentedComment #14
v1adimir CreditAttribution: v1adimir commented@Deciphered
I can upload to dropbox tgz'ed Drupal installation with described error. Can it help?
Comment #15
hass CreditAttribution: hass commented@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?
Comment #16
Deciphered CreditAttribution: Deciphered commentedThanks 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.