From 2c1cc83750b9d7a91d8d98dd3698fd70e7153d52 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 29 Apr 2010 21:41:20 +0000 Subject: [PATCH] Fix support for rewrites on IIS7. Fixes #12973 props Frumph and ruslany. git-svn-id: http://svn.automattic.com/wordpress/trunk@14312 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/misc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 1570b74d30..ed3054e114 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -488,7 +488,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[@name=\'wordpress\']'); + $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); if ( $rules->length == 0 ) return false; else @@ -517,7 +517,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[@name=\'wordpress\']'); + $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); if ( $rules->length > 0 ) { $child = $rules->item(0); $parent = $child->parentNode; @@ -557,7 +557,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[@name=\'wordpress\']'); + $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); if ( $wordpress_rules->length > 0 ) return true;