Make WordPress Core


Ignore:
Timestamp:
04/21/2016 09:36:50 AM (8 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5/src/wp-admin/includes/misc.php

    r36587 r37274  
    492492        return false;
    493493    $xpath = new DOMXPath($doc);
    494     $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
     494    $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
    495495    if ( $rules->length == 0 )
    496496        return false;
     
    522522        return false;
    523523    $xpath = new DOMXPath($doc);
    524     $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
     524    $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
    525525    if ( $rules->length > 0 ) {
    526526        $child = $rules->item(0);
     
    563563
    564564    // First check if the rule already exists as in that case there is no need to re-add it
    565     $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
     565    $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
    566566    if ( $wordpress_rules->length > 0 )
    567567        return true;
Note: See TracChangeset for help on using the changeset viewer.