Ticket #36506: misc.php.2.patch
File misc.php.2.patch, 1.9 KB (added by , 8 years ago) |
---|
-
src/wp-admin/includes/misc.php
491 491 if ( $doc->load($filename) === false ) 492 492 return false; 493 493 $xpath = new DOMXPath($doc); 494 $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); 494 $xpath->registerNamespace('php', 'http://php.net/xpath'); 495 $xpath->registerPhpFunctions('strtolower'); 496 $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(php:functionString("strtolower", @name),\'wordpress\')]'); 495 497 if ( $rules->length == 0 ) 496 498 return false; 497 499 else … … 521 523 if ( $doc -> load($filename) === false ) 522 524 return false; 523 525 $xpath = new DOMXPath($doc); 524 $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); 526 $xpath->registerNamespace('php', 'http://php.net/xpath'); 527 $xpath->registerPhpFunctions('strtolower'); 528 $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(php:functionString("strtolower", @name),\'wordpress\')]'); 525 529 if ( $rules->length > 0 ) { 526 530 $child = $rules->item(0); 527 531 $parent = $child->parentNode; … … 560 564 return false; 561 565 562 566 $xpath = new DOMXPath($doc); 567 $xpath->registerNamespace('php', 'http://php.net/xpath'); 568 $xpath->registerPhpFunctions('strtolower'); 563 569 564 570 // 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\')]');571 $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(php:functionString("strtolower", @name),\'wordpress\')]'); 566 572 if ( $wordpress_rules->length > 0 ) 567 573 return true; 568 574