Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #45970


Ignore:
Timestamp:
01/13/2019 10:34:19 PM (6 years ago)
Author:
swissspidy
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #45970 – Description

    initial v1  
    33The code responsible for this check is located in \wp-admin\includes\misc.php (line 748)
    44
     5{{{
    56        // First check if the rule already exists as in that case there is no need to re-add it
    67        $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
    78        if ( $wordpress_rules->length > 0 )
    89                return true;
     10}}}
    911
    1012The fix could be to register the namespace:
    1113
     14{{{
    1215$xpath->registerNamespace("x", "http://schemas.microsoft.com/.NetConfiguration/v2.0");
     16}}}
    1317
    14 and then in $xpath->query to check also for /x:configuration/x:system.webServer/x:rewrite/x:rules/x:rule[starts-with(@name,\'WordPress\')]
     18and then in `$xpath->query` to check also for `/x:configuration/x:system.webServer/x:rewrite/x:rules/x:rule[starts-with(@name,\'WordPress\')]`
    1519
    1620In this way it works without problem and does not break the site.