From a47fa4f1970996a2aa041ea53a37c4918065cc4b Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 21 Apr 2016 09:33:27 +0000 Subject: [PATCH] Rewrite Rules: After [36953], correctly replace existing rules on IIS when updating them. Props WiZZarD_. Fixes #36506 for trunk. Built from https://develop.svn.wordpress.org/trunk@37273 git-svn-id: http://core.svn.wordpress.org/trunk@37239 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/misc.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 64cc521544..4efb1d0b30 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -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; diff --git a/wp-includes/version.php b/wp-includes/version.php index eead0e32e4..54ef836a7c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37272'; +$wp_version = '4.6-alpha-37273'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.