Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -662,10 +662,26 @@ |
663 | 663 | return $text; |
664 | 664 | } |
665 | 665 | |
| 666 | + /** |
| 667 | + * Hack up a private DOCTYPE with HTML's standard entity declarations. |
| 668 | + * PHP 4 seemed to know these if you gave it an HTML doctype, but |
| 669 | + * PHP 5.1 doesn't. |
| 670 | + * @return string |
| 671 | + * @access private |
| 672 | + */ |
| 673 | + function hackDocType() { |
| 674 | + global $wgHtmlEntities; |
| 675 | + $out = "<!DOCTYPE html [\n"; |
| 676 | + foreach( $wgHtmlEntities as $entity => $codepoint ) { |
| 677 | + $out .= "<!ENTITY $entity \"&#$codepoint;\">"; |
| 678 | + } |
| 679 | + $out .= "]>\n"; |
| 680 | + return $out; |
| 681 | + } |
| 682 | + |
666 | 683 | function wellFormed( $text ) { |
667 | 684 | $html = |
668 | | - '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ' . |
669 | | - '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . |
| 685 | + $this->hackDocType() . |
670 | 686 | '<html>' . |
671 | 687 | $text . |
672 | 688 | '</html>'; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -282,6 +282,7 @@ |
283 | 283 | * (bug 1850) Allow red-links on image pages linked with [[:image:foo]] |
284 | 284 | * (bug 360) Let Whatlinkshere track [[:image:foo]] links |
285 | 285 | * (bug 4153) Fix block length localizations in Greek |
| 286 | +* Fix XML validity checks in parser tests on PHP 5.1 |
286 | 287 | |
287 | 288 | |
288 | 289 | === Caveats === |