Make WordPress Core

Ticket #16953: mu-symlinks.diff

File mu-symlinks.diff, 884 bytes (added by jdgrimes, 11 years ago)

Resolve MU-plugin and single file plugin symlinks

  • src/wp-includes/plugin.php

     
    642642function wp_register_plugin_realpath( $file ) {
    643643        global $wp_plugin_paths;
    644644
    645         $plugin_path = wp_normalize_path( dirname( $file ) );
    646         $plugin_realpath = wp_normalize_path( dirname( realpath( $file ) ) );
     645        $file = wp_normalize_path( $file );
     646        $realfile = wp_normalize_path( realpath( $file ) );
    647647
     648        $plugin_path = dirname( $file );
     649        $plugin_realpath = dirname( $realfile );
     650
     651        if ( $plugin_path == wp_normalize_path( WP_PLUGIN_DIR ) || $plugin_path == wp_normalize_path( WPMU_PLUGIN_DIR ) ) {
     652                $plugin_path = $file;
     653                $plugin_realpath = $realfile;
     654        }
     655
    648656        if ( $plugin_path !== $plugin_realpath ) {
    649657                $wp_plugin_paths[ $plugin_path ] = $plugin_realpath;
    650658        }