mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Media: Fix wp_unique_filename() to check for name collisions with all alternate file names when an image may be converted after uploading. This includes possible collinions with pre-existing images whose sub-sizes/thumbnails are regenerated.
Props ianmjones, azaozz. Fixes #53668. git-svn-id: https://develop.svn.wordpress.org/trunk@51653 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -591,13 +591,11 @@ abstract class WP_Image_Editor {
|
||||
* @return string|false
|
||||
*/
|
||||
protected static function get_extension( $mime_type = null ) {
|
||||
$extensions = explode( '|', array_search( $mime_type, wp_get_mime_types(), true ) );
|
||||
|
||||
if ( empty( $extensions[0] ) ) {
|
||||
if ( empty( $mime_type ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $extensions[0];
|
||||
return wp_get_default_extension_for_mime_type( $mime_type );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user