I have a 'Plain HTML' custom text format whose only filter is Pathologic. I've globally configured it thusly:

Processed URL format = Full URL

All base paths for this site:

The first item is the live website. The second is the Drupal 6 version of the site which we've copied content from, and the last is the new Drupal 7 version of the site with the copied content (body text which includes links, etc) from the Drupal 6 version.

This is the HTML I entered for an image with the 'Plain HTML' filter:

<img src="sites/default/files/styles/thumbnail/my-image.jpg" />

This is what I expected when viewing on the http://stage.devsite.com/site_d7 domain:

<img src="http://stage.devsite.com/site_d7/sites/default/files/styles/thumbnail/my-image.jpg" />

However, this was the result:

<img src="http://stage.devsite.com/site_d7/_d7/sites/default/files/styles/thumbnail/my-image.jpg" />

As you can see, there's an extra, errant '/_d7/' path argument in there.

When I changed the base path list to the following:

I had absolutely no problem at all and things rendered by Pathologic worked as expected:

<img src="http://stage.devsite.com/sd7/sites/default/files/styles/thumbnail/my-image.jpg" />

I'm certain this occurs when two base paths share the same string if matching from the beginning of the string.

Comments

amaisano created an issue. See original summary.

amaisano’s picture

Issue summary: View changes
amaisano’s picture

Title: If a base path contains part of another base path's string, bad stuff happens » Multiple base paths that share a common string cause double replacement

More mature title.

amaisano’s picture

Issue tags: +regex
amaisano’s picture

I tagged issue 2396221 as related because I was using tokens for the file path. Not 100% sure if this is only a token problem. If no one else can reproduce on vanilla, I can try w/o tokens and post my results.