Fix plugin basename for Windows servers. Fixes #3002 props Ozh
git-svn-id: http://svn.automattic.com/wordpress/trunk@5924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c6d79a79b0
commit
07ff444b6f
|
@ -237,8 +237,9 @@ function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args
|
||||||
* @return string The name of a plugin.
|
* @return string The name of a plugin.
|
||||||
*/
|
*/
|
||||||
function plugin_basename($file) {
|
function plugin_basename($file) {
|
||||||
$file = preg_replace('|\\\\+|', '\\\\', $file);
|
$file = str_replace('\\','/',$file); // sanitize for Win32 installs
|
||||||
$file = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', $file);
|
$file = preg_replace('|/+|','/', $file); // remove any duplicate slash
|
||||||
|
$file = preg_replace('|^.*/wp-content/plugins/|','',$file); // get relative path from plugins dir
|
||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue