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

git-svn-id: https://develop.svn.wordpress.org/trunk@11072 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-04-23 21:45:38 +00:00
parent 5e6528cd14
commit 8757f218ea
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;
} }