Reduce consecutive backslashes to one backslash. Handy when escaped windows paths are passed in.

git-svn-id: https://develop.svn.wordpress.org/trunk@3340 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-12-22 05:18:18 +00:00
parent 33562dafac
commit 96d9aa75ae

View File

@ -2252,6 +2252,7 @@ function register_deactivation_hook($file, $function) {
}
function plugin_basename($file) {
$file = preg_replace('|\\\\+|', '\\\\', $file);
$file = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', $file);
return $file;
}