str_replace() should only replace $basename once, in case you have that string in your filename.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm’s picture

Issue tags: +drupal.org D7
FileSize
1.1 KB

Patch attach

drumm’s picture

Status: Active » Needs review
drumm’s picture

FileSize
1.1 KB

Same patch for the testbot.

We ran into this on Drupal.org because we have files/issues/downloadfiles.png and files/issues/download.png

Status: Needs review » Needs work

The last submitted patch, 1542854.patch, failed testing.

drumm’s picture

Status: Needs work » Needs review
FileSize
1.14 KB

New approach because I didn't read PHP documentation.

drumm’s picture

Title: system_update_7061() converts filepaths to aggressively. » system_update_7061() converts filepaths too aggressively
BTMash’s picture

I just talked about this with webchick - the patch looks awesome but it would be a good idea to have atleast one test for this. I'll try and write out a test sometime tonight to make sure this works as expected.

BTMash’s picture

FileSize
3.55 KB
2.79 KB

Ok, here is a preliminary stab at the test and test+patch. It should fail and pass as expected.

webchick’s picture

Status: Needs review » Fixed

Excellent. Thank you so much for the patch drumm, and the test, BTMash! This is one of those things that's likely to destroy data without obviously doing so, so happy to have found it and fixed it.

Committed and pushed to 7.x.

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