mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 22:24:36 +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:
@@ -2096,7 +2096,7 @@ function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false
|
||||
if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) {
|
||||
$error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];
|
||||
} else {
|
||||
$error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
|
||||
$error_path = wp_basename( $uploads['basedir'] ) . $uploads['subdir'];
|
||||
}
|
||||
|
||||
$uploads['error'] = sprintf(
|
||||
@@ -2381,7 +2381,7 @@ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
|
||||
if ( 0 === strpos( $upload['basedir'], ABSPATH ) ) {
|
||||
$error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir'];
|
||||
} else {
|
||||
$error_path = basename( $upload['basedir'] ) . $upload['subdir'];
|
||||
$error_path = wp_basename( $upload['basedir'] ) . $upload['subdir'];
|
||||
}
|
||||
|
||||
$message = sprintf(
|
||||
|
||||
Reference in New Issue
Block a user