WordPress 4.5.1
[autoinstalls/wordpress.git] / wp-admin / includes / misc.php
index 64cc521544231dc887e187b029a01dfb1fa64edc..4efb1d0b3056ee76b652e6fbbfc74404a2b967b7 100644 (file)
@@ -491,7 +491,7 @@ function iis7_rewrite_rule_exists($filename) {
        if ( $doc->load($filename) === false )
                return false;
        $xpath = new DOMXPath($doc);
-       $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
+       $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
        if ( $rules->length == 0 )
                return false;
        else
@@ -521,7 +521,7 @@ function iis7_delete_rewrite_rule($filename) {
        if ( $doc -> load($filename) === false )
                return false;
        $xpath = new DOMXPath($doc);
-       $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
+       $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
        if ( $rules->length > 0 ) {
                $child = $rules->item(0);
                $parent = $child->parentNode;
@@ -562,7 +562,7 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) {
        $xpath = new DOMXPath($doc);
 
        // First check if the rule already exists as in that case there is no need to re-add it
-       $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
+       $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
        if ( $wordpress_rules->length > 0 )
                return true;