From: Platonides Date: Fri, 28 Oct 2011 15:13:27 +0000 (+0000) Subject: An alternative to using DOMDocument for normalizing when using Preprocessor_Hash. X-Git-Tag: 1.31.0-rc.0~26848 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=796ef5eff24a7d21c81e696e13cbd1d160083360;p=lhc%2Fweb%2Fwiklou.git An alternative to using DOMDocument for normalizing when using Preprocessor_Hash. Follow-up r99909. --- diff --git a/tests/phpunit/includes/parser/PreprocessorTest.php b/tests/phpunit/includes/parser/PreprocessorTest.php index e8c0c0ec42..033651d4e8 100644 --- a/tests/phpunit/includes/parser/PreprocessorTest.php +++ b/tests/phpunit/includes/parser/PreprocessorTest.php @@ -131,6 +131,8 @@ class PreprocessorTest extends MediaWikiTestCase { * @return string */ function normalizeXml( $xml ) { + return preg_replace( '!<([a-z]+)/>!', '<$1>', str_replace( ' />', '/>', $xml ) ); + $dom = new DOMDocument(); // 1 << 19 == XML_PARSE_HUGE, needed so newer versions of libxml2 don't barf when the XML is >256 levels deep $dom->loadXML( $xml, 1 << 19 );