Upload: Run the final file name collision test in wp_unique_filename() for each existing file + 1.

Props pbiron.
See #48975.

Built from https://develop.svn.wordpress.org/trunk@46976


git-svn-id: http://core.svn.wordpress.org/trunk@46776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2019-12-17 20:52:03 +00:00
parent da041582df
commit 6403619f92
2 changed files with 2 additions and 2 deletions

View File

@ -2492,7 +2492,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
// Ensure this never goes into infinite loop
// as it uses pathinfo() and regex in the check but string replacement for the changes.
$count = count( $files );
$i = 1;
$i = 0;
while ( $i <= $count && _wp_check_existing_file_names( $filename, $files ) ) {
$new_number = (int) $number + 1;

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.4-alpha-46974';
$wp_version = '5.4-alpha-46976';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.