mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
LJ tweaks.
git-svn-id: https://develop.svn.wordpress.org/trunk@3375 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1750,8 +1750,16 @@ function wp_handle_upload(&$file, $overrides = false) {
|
||||
} else {
|
||||
$number = '';
|
||||
$filename = $file['name'];
|
||||
while ( file_exists($uploads['path'] . "/$filename") )
|
||||
$filename = str_replace("$number.$ext", ++$number . ".$ext", $filename);
|
||||
if ( empty($ext) )
|
||||
$ext = '';
|
||||
else
|
||||
$ext = ".$ext";
|
||||
while ( file_exists($uploads['path'] . "/$filename") ) {
|
||||
if ( '' == "$number$ext" )
|
||||
$filename = $filename . ++$number . $ext;
|
||||
else
|
||||
$filename = str_replace("$number$ext", ++$number . $ext, $filename);
|
||||
}
|
||||
}
|
||||
|
||||
// Move the file to the uploads dir
|
||||
|
||||
Reference in New Issue
Block a user