WordPress.org

Make WordPress Core

Ticket #12973: multisitefix.diff

File multisitefix.diff, 1.3 KB (added by Frumph, 5 years ago)

Change to the misc.php for IIS7 rewrite rules to use start-with

  • misc.php

     
    488488        if ( $doc->load($filename) === false ) 
    489489                return false; 
    490490        $xpath = new DOMXPath($doc); 
    491         $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']'); 
     491        $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); 
    492492        if ( $rules->length == 0 ) 
    493493                return false; 
    494494        else 
     
    517517        if ( $doc -> load($filename) === false ) 
    518518                return false; 
    519519        $xpath = new DOMXPath($doc); 
    520         $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']'); 
     520        $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); 
    521521        if ( $rules->length > 0 ) { 
    522522                $child = $rules->item(0); 
    523523                $parent = $child->parentNode; 
     
    557557        $xpath = new DOMXPath($doc); 
    558558 
    559559        // First check if the rule already exists as in that case there is no need to re-add it 
    560         $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']'); 
     560        $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); 
    561561        if ( $wordpress_rules->length > 0 ) 
    562562                return true; 
    563563