Make WordPress Core

Changeset 27999


Ignore:
Timestamp:
04/07/2014 08:14:34 PM (13 years ago)
Author:
nacin
Message:

Don't try to resolve symlinks for single-file plugins. plugins_url() should not be used in this context anyway.

props rmccue.
fixes #16953.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r27294 r27999  
    639639 *
    640640 * @param string $file Known path to the file.
     641 * @return bool Whether the path was able to be registered.
    641642 */
    642643function wp_register_plugin_realpath( $file ) {
    643644        global $wp_plugin_paths;
    644645
     646        // Normalize, but store as static to avoid recalculation of a constant value
     647        static $wp_plugin_path, $wpmu_plugin_path;
     648        if ( ! isset( $wp_plugin_path ) ) {
     649                $wp_plugin_path   = wp_normalize_path( WP_PLUGIN_DIR   );
     650                $wpmu_plugin_path = wp_normalize_path( WPMU_PLUGIN_DIR );
     651        }
     652
    645653        $plugin_path = wp_normalize_path( dirname( $file ) );
    646654        $plugin_realpath = wp_normalize_path( dirname( realpath( $file ) ) );
    647655
     656        if ( $plugin_path === $wp_plugin_path || $plugin_path === $wpmu_plugin_path ) {
     657                return false;
     658        }
     659
    648660        if ( $plugin_path !== $plugin_realpath ) {
    649661                $wp_plugin_paths[ $plugin_path ] = $plugin_realpath;
    650662        }
     663
     664        return true;
    651665}
    652666
  • trunk/src/wp-settings.php

    r27158 r27999  
    169169// Load must-use plugins.
    170170foreach ( wp_get_mu_plugins() as $mu_plugin ) {
    171         wp_register_plugin_realpath( $mu_plugin );
    172171        include_once( $mu_plugin );
    173172}
Note: See TracChangeset for help on using the changeset viewer.