From ce91e7b85122dd40288aa45f7c2cd120e326584b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 3 Dec 2005 08:14:07 +0000 Subject: [PATCH] * Fix XML validity checks in parser tests on PHP 5.1 --- RELEASE-NOTES | 1 + maintenance/parserTests.inc | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9de94b5fb6..7abf2f5cc9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -282,6 +282,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 1850) Allow red-links on image pages linked with [[:image:foo]] * (bug 360) Let Whatlinkshere track [[:image:foo]] links * (bug 4153) Fix block length localizations in Greek +* Fix XML validity checks in parser tests on PHP 5.1 === Caveats === diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index 8197a768ff..06c3a4ad7a 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -662,10 +662,26 @@ class ParserTest { return $text; } + /** + * Hack up a private DOCTYPE with HTML's standard entity declarations. + * PHP 4 seemed to know these if you gave it an HTML doctype, but + * PHP 5.1 doesn't. + * @return string + * @access private + */ + function hackDocType() { + global $wgHtmlEntities; + $out = " $codepoint ) { + $out .= ""; + } + $out .= "]>\n"; + return $out; + } + function wellFormed( $text ) { $html = - '' . + $this->hackDocType() . '' . $text . ''; -- 2.20.1