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:
Aaron Jorbin
2019-03-01 20:57:26 +00:00
parent 4c45ff7c43
commit e421f262dc
32 changed files with 101 additions and 101 deletions
+2 -2
View File
@@ -231,7 +231,7 @@ class Tests_General_Template extends WP_UnitTestCase {
$filename = DIR_TESTDATA . '/images/test-image.jpg';
$contents = file_get_contents( $filename );
$upload = wp_upload_bits( basename( $filename ), null, $contents );
$upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
$this->site_icon_url = $upload['url'];
// Save the data
@@ -409,7 +409,7 @@ class Tests_General_Template extends WP_UnitTestCase {
function _insert_custom_logo() {
$filename = DIR_TESTDATA . '/images/test-image.jpg';
$contents = file_get_contents( $filename );
$upload = wp_upload_bits( basename( $filename ), null, $contents );
$upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
// Save the data.
$this->custom_logo_url = $upload['url'];