From dc994f5db553651d3082cbebb0a4be8690dc2776 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Wed, 6 Jul 2016 09:45:27 +0000 Subject: [PATCH] Plugins: In `plugin_basename()` sort plugin paths before resolving symlinks. `arsort()` sorts the paths reverse-alphabetically while preserving the keys. It results in a longer path being listed before a shorter one with the same base directory(ies). Props jdgrimes, ocean90. Fixes #28441. Built from https://develop.svn.wordpress.org/trunk@37983 git-svn-id: http://core.svn.wordpress.org/trunk@37924 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/plugin.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index e01b0e2fe4..73b59fd3c1 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -731,6 +731,7 @@ function plugin_basename( $file ) { // $wp_plugin_paths contains normalized paths. $file = wp_normalize_path( $file ); + arsort( $wp_plugin_paths ); foreach ( $wp_plugin_paths as $dir => $realdir ) { if ( strpos( $file, $realdir ) === 0 ) { $file = $dir . substr( $file, strlen( $realdir ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 904a5522d0..33c5543fc7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta1-37982'; +$wp_version = '4.6-beta1-37983'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.