Show
Ignore:
Timestamp:
05/27/08 17:55:24 (6 months ago)
Author:
ryan
Message:

Allow wp-content to exist outside of webroot. Props sambauers. see #6938

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/plugin.php

    r6726 r7999  
    435435 * plugin_basename() - Gets the basename of a plugin. 
    436436 * 
    437  * This method extract the name of a plugin from its filename. 
     437 * This method extracts the name of a plugin from its filename. 
    438438 * 
    439439 * @package WordPress 
     
    445445 * @param string $file The filename of plugin. 
    446446 * @return string The name of a plugin. 
     447 * @uses WP_PLUGIN_DIR 
    447448 */ 
    448449function plugin_basename($file) { 
    449450    $file = str_replace('\\','/',$file); // sanitize for Win32 installs 
    450451    $file = preg_replace('|/+|','/', $file); // remove any duplicate slash 
    451     $file = preg_replace('|^.*/' . PLUGINDIR . '/|','',$file); // get relative path from plugins dir 
     452    $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs 
     453    $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash 
     454    $file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir 
    452455    return $file; 
    453456}