WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/30/2016 03:08:06 PM (4 years ago)
Author:
ocean90
Message:

Plugins: In plugin_basename() normalize the file path before unresolving symlinks.

$wp_plugin_paths contains normalized paths, see wp_register_plugin_realpath().

Props jdgrimes, voldemortensen, flyingdr, ocean90.
Fixes #29154.

File:
1 edited

Legend:

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

    r36392 r37332  
    676676    global $wp_plugin_paths;
    677677
     678    // $wp_plugin_paths contains normalized paths.
     679    $file = wp_normalize_path( $file );
     680
    678681    foreach ( $wp_plugin_paths as $dir => $realdir ) {
    679682        if ( strpos( $file, $realdir ) === 0 ) {
     
    682685    }
    683686
    684     $file = wp_normalize_path( $file );
    685687    $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
    686688    $mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );
Note: See TracChangeset for help on using the changeset viewer.