WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.5/wp-admin/network.php

    r22982 r23296  
    313313    $slashed_home      = trailingslashit( get_option( 'home' ) );
    314314    $base              = parse_url( $slashed_home, PHP_URL_PATH );
    315     $wp_dir_from_root  = preg_replace( '#^' . preg_quote( $_SERVER['DOCUMENT_ROOT'], '#' ) . '#', '', ABSPATH );
    316     $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) );
     315    $document_root_fix = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) );
     316    $abspath_fix       = str_replace( '\\', '/', ABSPATH );
     317    $home_path         = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : str_replace( '\\', '/', get_home_path() );
     318    $wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', $abspath_fix );
    317319    $rewrite_base      = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
    318320
    319     $home_path         = get_home_path();
    320321
    321322    $location_of_wp_config = ABSPATH;
     
    412413        $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';
    413414
    414         $web_config_file = <<<EOF
    415 <?xml version="1.0" encoding="UTF-8"?>
     415        $web_config_file = '<?xml version="1.0" encoding="UTF-8"?>
    416416<configuration>
    417417    <system.webServer>
     
    425425                    $web_config_file .= '
    426426                <rule name="WordPress Rule for Files" stopProcessing="true">
    427                     <match url="^{$iis_subdir_match}files/(.+)" ignoreCase="false" />
    428                     <action type="Rewrite" url="{$iis_rewrite_base}wp-includes/ms-files.php?file={R:1}" appendQueryString="false" />
     427                    <match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" />
     428                    <action type="Rewrite" url="' . $iis_rewrite_base . 'wp-includes/ms-files.php?file={R:1}" appendQueryString="false" />
    429429                </rule>';
    430430                }
    431431                $web_config_file .= '
    432432                <rule name="WordPress Rule 2" stopProcessing="true">
    433                     <match url="^{$iis_subdir_match}wp-admin$" ignoreCase="false" />
    434                     <action type="Redirect" url="{$iis_subdir_replacement}wp-admin/" redirectType="Permanent" />
     433                    <match url="^' . $iis_subdir_match . 'wp-admin$" ignoreCase="false" />
     434                    <action type="Redirect" url="' . $iis_subdir_replacement . 'wp-admin/" redirectType="Permanent" />
    435435                </rule>
    436436                <rule name="WordPress Rule 3" stopProcessing="true">
     
    443443                </rule>
    444444                <rule name="WordPress Rule 4" stopProcessing="true">
    445                     <match url="^{$iis_subdir_match}(wp-(content|admin|includes).*)" ignoreCase="false" />
    446                     <action type="Rewrite" url="{$iis_rewrite_base}{R:1}" />
     445                    <match url="^' . $iis_subdir_match . '(wp-(content|admin|includes).*)" ignoreCase="false" />
     446                    <action type="Rewrite" url="' . $iis_rewrite_base . '{R:1}" />
    447447                </rule>
    448448                <rule name="WordPress Rule 5" stopProcessing="true">
    449                     <match url="^{$iis_subdir_match}([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
    450                     <action type="Rewrite" url="{$iis_rewrite_base}{R:2}" />
     449                    <match url="^' . $iis_subdir_match . '([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
     450                    <action type="Rewrite" url="' . $iis_rewrite_base . '{R:2}" />
    451451                </rule>
    452452                <rule name="WordPress Rule 6" stopProcessing="true">
     
    457457        </rewrite>
    458458    </system.webServer>
    459 </configuration>
    460 EOF;
     459</configuration>';
    461460
    462461    ?>
Note: See TracChangeset for help on using the changeset viewer.