summaryrefslogtreecommitdiffstats
path: root/wp-includes/plugin.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-13 17:21:00 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-13 17:21:00 +0000
commit12de05107e4c8b006bde6ee8916f34eb476d08da (patch)
tree123ee54ecd1f3f777373b7df54a4604012d43640 /wp-includes/plugin.php
parente51c7a9ca4bfdb45fa3ec7334bd33871e78c68b1 (diff)
downloadwordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.gz
wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.xz
wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.zip
WP Merge with revision 8075
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1328 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/plugin.php')
-rw-r--r--wp-includes/plugin.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php
index 829efc8..57e2677 100644
--- a/wp-includes/plugin.php
+++ b/wp-includes/plugin.php
@@ -434,7 +434,7 @@ function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args
/**
* plugin_basename() - Gets the basename of a plugin.
*
- * This method extract the name of a plugin from its filename.
+ * This method extracts the name of a plugin from its filename.
*
* @package WordPress
* @subpackage Plugin
@@ -444,11 +444,14 @@ function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args
*
* @param string $file The filename of plugin.
* @return string The name of a plugin.
+ * @uses WP_PLUGIN_DIR
*/
function plugin_basename($file) {
$file = str_replace('\\','/',$file); // sanitize for Win32 installs
$file = preg_replace('|/+|','/', $file); // remove any duplicate slash
- $file = preg_replace('|^.*/' . PLUGINDIR . '/|','',$file); // get relative path from plugins dir
+ $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs
+ $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash
+ $file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir
$file = preg_replace('|^.*/' . MUPLUGINDIR . '/|','',$file); // get relative path from plugins dir
return $file;
}