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

git-svn-id: http://svn.automattic.com/wordpress/trunk@3340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-12-22 05:18:18 +00:00
parent 2a1cd8b2cd
commit 65223a924f
1 changed files with 1 additions and 0 deletions

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