Remove slash from plugin_basename(), props alexrabe, fixes #9561

git-svn-id: http://svn.automattic.com/wordpress/trunk@11072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-04-23 21:45:38 +00:00
parent 267f508f2f
commit 4f250c27cf
1 changed files with 1 additions and 1 deletions

View File

@ -494,7 +494,7 @@ function plugin_basename($file) {
$plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash
$mu_plugin_dir = str_replace('\\','/',WPMU_PLUGIN_DIR); // sanitize for Win32 installs $mu_plugin_dir = str_replace('\\','/',WPMU_PLUGIN_DIR); // sanitize for Win32 installs
$mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash
$file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir
return $file; return $file;
} }