From 796ef5eff24a7d21c81e696e13cbd1d160083360 Mon Sep 17 00:00:00 2001 From: Platonides Date: Fri, 28 Oct 2011 15:13:27 +0000 Subject: [PATCH] An alternative to using DOMDocument for normalizing when using Preprocessor_Hash. Follow-up r99909. --- tests/phpunit/includes/parser/PreprocessorTest.php | 2 ++ 1 file changed, 2 insertions(+) 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 ); -- 2.20.1