Fix plugins_url() for MU-plugins when running on Windows. Fixes #12080
git-svn-id: http://svn.automattic.com/wordpress/trunk@12963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9dc63f2f43
commit
226600f5b2
|
@ -1865,16 +1865,19 @@ function content_url($path = '') {
|
|||
function plugins_url($path = '', $plugin = '') {
|
||||
$scheme = ( is_ssl() ? 'https' : 'http' );
|
||||
|
||||
if ( $plugin !== '' && preg_match('#^' . preg_quote(WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR, '#') . '#', $plugin) ) {
|
||||
$url = WPMU_PLUGIN_URL;
|
||||
} else {
|
||||
$url = WP_PLUGIN_URL;
|
||||
$mu_plugin_dir = WPMU_PLUGIN_DIR;
|
||||
foreach ( array('path', 'plugin', 'mu_plugin_dir') as $var ) {
|
||||
$$var = str_replace('\\' ,'/', $$var); // sanitize for Win32 installs
|
||||
$$var = preg_replace('|/+|', '/', $$var);
|
||||
}
|
||||
|
||||
if ( 0 === strpos($url, 'http') ) {
|
||||
if ( is_ssl() )
|
||||
if ( !empty($plugin) && 0 === strpos($plugin, $mu_plugin_dir) )
|
||||
$url = WPMU_PLUGIN_URL;
|
||||
else
|
||||
$url = WP_PLUGIN_URL;
|
||||
|
||||
if ( 0 === strpos($url, 'http') && is_ssl() )
|
||||
$url = str_replace( 'http://', "{$scheme}://", $url );
|
||||
}
|
||||
|
||||
if ( !empty($plugin) && is_string($plugin) ) {
|
||||
$folder = dirname(plugin_basename($plugin));
|
||||
|
|
Loading…
Reference in New Issue