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.

Built from https://develop.svn.wordpress.org/trunk@44785


git-svn-id: http://core.svn.wordpress.org/trunk@44617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Jorbin
2019-03-01 20:58:52 +00:00
parent e0e99fe82e
commit 71cf332e65
18 changed files with 44 additions and 44 deletions

View File

@@ -99,7 +99,7 @@ function wp_import_handle_upload() {
// Construct the object array
$object = array(
'post_title' => basename( $upload['file'] ),
'post_title' => wp_basename( $upload['file'] ),
'post_content' => $upload['url'],
'post_mime_type' => $upload['type'],
'guid' => $upload['url'],