Make WordPress Core

Changeset 12963


Ignore:
Timestamp:
02/05/2010 12:39:04 PM (15 years ago)
Author:
dd32
Message:

Fix plugins_url() for MU-plugins when running on Windows. Fixes #12080

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r12923 r12963  
    18661866    $scheme = ( is_ssl() ? 'https' : 'http' );
    18671867
    1868     if ( $plugin !== '' && preg_match('#^' . preg_quote(WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR, '#') . '#', $plugin) ) {
     1868    $mu_plugin_dir = WPMU_PLUGIN_DIR;
     1869    foreach ( array('path', 'plugin', 'mu_plugin_dir') as $var ) {
     1870        $$var = str_replace('\\' ,'/', $$var); // sanitize for Win32 installs
     1871        $$var = preg_replace('|/+|', '/', $$var);
     1872    }
     1873
     1874    if ( !empty($plugin) && 0 === strpos($plugin, $mu_plugin_dir) )
    18691875        $url = WPMU_PLUGIN_URL;
    1870     } else {
     1876    else
    18711877        $url = WP_PLUGIN_URL;
    1872     }
    1873 
    1874     if ( 0 === strpos($url, 'http') ) {
    1875         if ( is_ssl() )
    1876             $url = str_replace( 'http://', "{$scheme}://", $url );
    1877     }
     1878
     1879    if ( 0 === strpos($url, 'http') && is_ssl() )
     1880        $url = str_replace( 'http://', "{$scheme}://", $url );
    18781881
    18791882    if ( !empty($plugin) && is_string($plugin) ) {
    18801883        $folder = dirname(plugin_basename($plugin));
    1881         if ('.' != $folder)
     1884        if ( '.' != $folder )
    18821885            $url .= '/' . ltrim($folder, '/');
    18831886    }
Note: See TracChangeset for help on using the changeset viewer.