Make WordPress Core

Ticket #9561: 9561.diff

File 9561.diff, 2.0 KB (added by Denis-de-Bernardy, 16 years ago)
  • Users/denis/Sites/sem-pro/wp-includes/plugin.php

     
    492492        $file = preg_replace('|/+|','/', $file); // remove any duplicate slash
    493493        $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs
    494494        $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash
    495         $file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir
     495        $mu_plugin_dir = str_replace('\\','/',WPMU_PLUGIN_DIR); // sanitize for Win32 installs
     496        $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash
     497        $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir
    496498        return $file;
    497499}
    498500
  • Users/denis/Sites/sem-pro/wp-includes/link-template.php

     
    17521752*/
    17531753function plugins_url($path = '', $plugin = '') {
    17541754        $scheme = ( is_ssl() ? 'https' : 'http' );
    1755         $url = WP_PLUGIN_URL;
     1755       
     1756        if ( $plugin !== '' && preg_match('#^' . preg_quote(WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR, '#') . '#', $plugin) ) {
     1757                $url = WPMU_PLUGIN_URL;
     1758        } else {
     1759                $url = WP_PLUGIN_URL;
     1760        }
     1761
    17561762        if ( 0 === strpos($url, 'http') ) {
    17571763                if ( is_ssl() )
    17581764                        $url = str_replace( 'http://', "{$scheme}://", $url );
    17591765        }
    1760 
    1761         if ( !empty($plugin) && is_string($plugin) )
    1762         {
     1766       
     1767        if ( !empty($plugin) && is_string($plugin) ) {
    17631768                $folder = dirname(plugin_basename($plugin));
    17641769                if ('.' != $folder)
    17651770                        $url .= '/' . ltrim($folder, '/');
    17661771        }
    1767 
     1772       
    17681773        if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
    17691774                $url .= '/' . ltrim($path, '/');
    17701775