r101138 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101137‎ | r101138 | r101139 >
Date:15:13, 28 October 2011
Author:platonides
Status:ok (Comments)
Tags:
Comment:
An alternative to using DOMDocument for normalizing when using Preprocessor_Hash.
Follow-up r99909.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/parser/PreprocessorTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/parser/PreprocessorTest.php
@@ -131,6 +131,8 @@
132132 * @return string
133133 */
134134 function normalizeXml( $xml ) {
 135+ return preg_replace( '!<([a-z]+)/>!', '<$1></$1>', str_replace( ' />', '/>', $xml ) );
 136+
135137 $dom = new DOMDocument();
136138 // 1 << 19 == XML_PARSE_HUGE, needed so newer versions of libxml2 don't barf when the XML is >256 levels deep
137139 $dom->loadXML( $xml, 1 << 19 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99909Followup r80375: let PreprocessorTest work on Preprocessor_Hash etc as well a...brion20:21, 15 October 2011

Comments

#Comment by Hashar (talk | contribs)   15:00, 25 November 2011

You might want to remove the now unreachable code in normalizeXml() :)

#Comment by Platonides (talk | contribs)   14:45, 26 November 2011

I left it there as I feared it might not be welcome. Nobody complained in a month, so it could go.

Status & tagging log