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.
str_replace()
should only replace $basename
once, in case you have that string in your filename.
Comment | File | Size | Author |
---|---|---|---|
#8 | 1542854.testonly.patch | 2.79 KB | BTMash |
#8 | 1542854.patch | 3.55 KB | BTMash |
#5 | 1542854.patch | 1.14 KB | drumm |
#3 | 1542854.patch | 1.1 KB | drumm |
#1 | 1542854.patch | 1.1 KB | drumm |
Comments
Comment #1
drummPatch attach
Comment #2
drummComment #3
drummSame patch for the testbot.
We ran into this on Drupal.org because we have
files/issues/downloadfiles.png
andfiles/issues/download.png
Comment #5
drummNew approach because I didn't read PHP documentation.
Comment #6
drummComment #7
BTMash CreditAttribution: BTMash commentedI 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.
Comment #8
BTMash CreditAttribution: BTMash commentedOk, here is a preliminary stab at the test and test+patch. It should fail and pass as expected.
Comment #9
webchickExcellent. 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.