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
This commit is contained in:
Pascal Birchler 2016-04-21 09:33:27 +00:00
parent 7b03510520
commit a47fa4f197
2 changed files with 4 additions and 4 deletions

View File

@ -491,7 +491,7 @@ function iis7_rewrite_rule_exists($filename) {
if ( $doc->load($filename) === false ) if ( $doc->load($filename) === false )
return false; return false;
$xpath = new DOMXPath($doc); $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 ) if ( $rules->length == 0 )
return false; return false;
else else
@ -521,7 +521,7 @@ function iis7_delete_rewrite_rule($filename) {
if ( $doc -> load($filename) === false ) if ( $doc -> load($filename) === false )
return false; return false;
$xpath = new DOMXPath($doc); $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 ) { if ( $rules->length > 0 ) {
$child = $rules->item(0); $child = $rules->item(0);
$parent = $child->parentNode; $parent = $child->parentNode;
@ -562,7 +562,7 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) {
$xpath = new DOMXPath($doc); $xpath = new DOMXPath($doc);
// First check if the rule already exists as in that case there is no need to re-add it // 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 ) if ( $wordpress_rules->length > 0 )
return true; return true;

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.