WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/01/2019 08:57:26 PM (10 months ago)
Author:
jorbin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/intermediateSize.php

    r42343 r44785  
    1818    public function _make_attachment( $file, $parent_post_id = 0 ) {
    1919        $contents = file_get_contents( $file );
    20         $upload   = wp_upload_bits( basename( $file ), null, $contents );
     20        $upload   = wp_upload_bits( wp_basename( $file ), null, $contents );
    2121
    2222        return parent::_make_attachment( $upload, $parent_post_id );
Note: See TracChangeset for help on using the changeset viewer.