Make WordPress Core


Ignore:
Timestamp:
08/20/2016 11:35:50 PM (8 years ago)
Author:
wonderboymusic
Message:

Media: when calling pathinfo(), also pass a PATHINFO_* constant to avoid array notices for unset keys.

Props JaworskiMatt.
Fixes #37608.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r38235 r38294  
    7878    global $wp_file_descriptions, $allowed_files;
    7979
    80     $relative_pathinfo = pathinfo( $file );
     80    $dirname = pathinfo( $file, PATHINFO_DIRNAME );
     81
    8182    $file_path = $allowed_files[ $file ];
    82     if ( isset( $wp_file_descriptions[ basename( $file ) ] ) && '.' === $relative_pathinfo['dirname'] ) {
     83    if ( isset( $wp_file_descriptions[ basename( $file ) ] ) && '.' === $dirname ) {
    8384        return $wp_file_descriptions[ basename( $file ) ];
    8485    } elseif ( file_exists( $file_path ) && is_file( $file_path ) ) {
Note: See TracChangeset for help on using the changeset viewer.