From 9f63726656700c24295bb880a0b5ba6d8f792e39 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Thu, 21 Apr 2016 09:37:29 +0000 Subject: [PATCH] Rewrite Rules: After [36953], correctly replace existing rules on IIS when updating them. Merge of [37273] to the 4.5 branch. Props WiZZarD_. Fixes #36506. Built from https://develop.svn.wordpress.org/branches/4.5@37274 git-svn-id: http://core.svn.wordpress.org/branches/4.5@37240 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 4ed1d5decb..c0939f02bd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5.1-alpha-37257'; +$wp_version = '4.5.1-alpha-37274'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.