Upload: Fix the final file name collision test in wp_unique_filename() when uploading a file with upper case extension. Add a unit test to catch that in the future.

Fixes #48975 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@46966 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2019-12-16 23:42:34 +00:00
parent 735b3543db
commit 99ef48a585
2 changed files with 15 additions and 3 deletions
+2
View File
@@ -208,6 +208,8 @@ class Tests_Functions extends WP_UnitTestCase {
// Test collision with existing sub-size filename.
// Existing files: one-blue-pixel-100x100.png, one-blue-pixel-1-100x100.png.
$this->assertEquals( 'one-blue-pixel-2.png', wp_unique_filename( $testdir, 'one-blue-pixel.png' ) );
// Same as above with upper case extension.
$this->assertEquals( 'one-blue-pixel-2.png', wp_unique_filename( $testdir, 'one-blue-pixel.PNG' ) );
remove_filter( 'upload_dir', array( $this, 'upload_dir_patch_basedir' ) );
}