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/functions.php

    r44690 r44785  
    20972097                    $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];
    20982098                } else {
    2099                     $error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
     2099                    $error_path = wp_basename( $uploads['basedir'] ) . $uploads['subdir'];
    21002100                }
    21012101
     
    23822382            $error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir'];
    23832383        } else {
    2384             $error_path = basename( $upload['basedir'] ) . $upload['subdir'];
     2384            $error_path = wp_basename( $upload['basedir'] ) . $upload['subdir'];
    23852385        }
    23862386
Note: See TracChangeset for help on using the changeset viewer.