[wp-trac] [WordPress Trac] #42437: Thumbnails can overwrite other uploads if filename matches
WordPress Trac
noreply at wordpress.org
Thu Dec 5 02:00:17 UTC 2019
#42437: Thumbnails can overwrite other uploads if filename matches
--------------------------+-----------------------
Reporter: Viper007Bond | Owner: pbiron
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.3.1
Component: Upload | Version: 4.8.3
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+-----------------------
Comment (by azaozz):
In 42437.3.diff:
- Based on 42437.2.diff.
- Remove the case 1 above "Adds a number to any file that could cause a
collision with sub-sizes.". Can cause "false-positives" and perhaps better
to not rename the file unless we have to.
- Ensure the `$number` is reused across different tests so it doesn't end
up with name like `file-1-2.ext`.
- Use a helper function to test for possible collisions.
- Some code improvements.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42437#comment:39>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list