WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/01/2019 08:57:26 PM (9 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/src/wp-includes/media.php

    r44566 r44785  
    28722872
    28732873    $file     = get_attached_file( $attachment->ID );
    2874     $filename = basename( $file );
     2874    $filename = wp_basename( $file );
    28752875
    28762876    $objects = array( 'attachment' );
Note: See TracChangeset for help on using the changeset viewer.