Don't use variable variables in `plugins_url()`.

See #27881.

Built from https://develop.svn.wordpress.org/trunk@28739


git-svn-id: http://core.svn.wordpress.org/trunk@28553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-06-11 18:18:14 +00:00
parent e5e8a83cf4
commit 07d4069444
1 changed files with 6 additions and 5 deletions

View File

@ -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;