From 35af75077b15bbdba01898b86b718b9e7f3ee389 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 11 Jun 2014 18:17:52 +0000 Subject: [PATCH] Don't use variable variables in `plugins_url()`. See #27881. git-svn-id: https://develop.svn.wordpress.org/trunk@28739 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 739d6bb511..538e0d8275 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -2637,11 +2637,12 @@ function content_url($path = '') { */ function plugins_url($path = '', $plugin = '') { - $mu_plugin_dir = WPMU_PLUGIN_DIR; - foreach ( array('path', 'plugin', 'mu_plugin_dir') as $var ) { - $$var = str_replace('\\' ,'/', $$var); // sanitize for Win32 installs - $$var = preg_replace('|/+|', '/', $$var); - } + $path = str_replace( '\\' ,'/', $path ); // sanitize for Win32 installs + $path = preg_replace( '|/+|', '/', $path ); + $plugin = str_replace( '\\' ,'/', $plugin ); // sanitize for Win32 installs + $plugin = preg_replace( '|/+|', '/', $plugin ); + $mu_plugin_dir = str_replace( '\\' ,'/', WPMU_PLUGIN_DIR ); // sanitize for Win32 installs + $mu_plugin_dir = preg_replace( '|/+|', '/', $mu_plugin_dir ); if ( !empty($plugin) && 0 === strpos($plugin, $mu_plugin_dir) ) $url = WPMU_PLUGIN_URL;