mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +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:
@@ -1360,7 +1360,7 @@ final class WP_Customize_Manager {
|
||||
if ( ! $attachment_id ) {
|
||||
|
||||
// Copy file to temp location so that original file won't get deleted from theme after sideloading.
|
||||
$temp_file_name = wp_tempnam( basename( $file_path ) );
|
||||
$temp_file_name = wp_tempnam( wp_basename( $file_path ) );
|
||||
if ( $temp_file_name && copy( $file_path, $temp_file_name ) ) {
|
||||
$file_array['tmp_name'] = $temp_file_name;
|
||||
}
|
||||
@@ -1621,7 +1621,7 @@ final class WP_Customize_Manager {
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
$file_name = basename( $attachment['file'] );
|
||||
$file_name = wp_basename( $attachment['file'] );
|
||||
|
||||
// Skip file types that are not recognized.
|
||||
$checked_filetype = wp_check_filetype( $file_name );
|
||||
@@ -4594,7 +4594,7 @@ final class WP_Customize_Manager {
|
||||
|
||||
if ( $this->return_url ) {
|
||||
$return_url = $this->return_url;
|
||||
} elseif ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
|
||||
} elseif ( $referer && ! in_array( wp_basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
|
||||
$return_url = $referer;
|
||||
} elseif ( $this->preview_url ) {
|
||||
$return_url = $this->preview_url;
|
||||
|
||||
Reference in New Issue
Block a user