mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Replace usages of basename() with wp_basename() in order to support multibyte filenames
This is focused on the pieces of code that touch media files and the tests that support them. `basename` isn't multibyte compatible out of the box. See http://php.net/basename and https://bugs.php.net/bug.php?id=62119. See #43170. Props Viper007Bond. git-svn-id: https://develop.svn.wordpress.org/trunk@44785 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1524,7 +1524,7 @@ EOF;
|
||||
// Copy hash generation method used in wp_save_image().
|
||||
$hash = 'e' . time() . rand( 100, 999 );
|
||||
|
||||
$filename_base = basename( $image_meta['file'], '.png' );
|
||||
$filename_base = wp_basename( $image_meta['file'], '.png' );
|
||||
|
||||
// Add the hash to the image URL
|
||||
$image_url = str_replace( $filename_base, $filename_base . '-' . $hash, $image_url );
|
||||
|
||||
Reference in New Issue
Block a user