From: Aryeh Gregor Date: Wed, 30 Jun 2010 23:08:49 +0000 (+0000) Subject: Use unconditionally X-Git-Tag: 1.31.0-rc.0~36324 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=45db6ec98d0e8241f4340a5349c6552c60e0e7d4;p=lhc%2Fweb%2Fwiklou.git Use unconditionally See r67090 for context. Everywhere that I've found this breaking well-formedness is fixed. Tested with the following Python: import xml.sax class Myhandler(xml.sax.ContentHandler): pass h = Myhandler() for page in ('BrokenRedirects', 'Deadendpages', 'DoubleRedirects', 'Longpages', 'Ancientpages', 'Lonelypages', 'Fewestrevisions', 'Withoutinterwiki', 'Protectedpages', 'Protectedtitles', 'Shortpages', 'Uncategorizedcategories', 'Uncategorizedimages', 'Uncategorizedpages', 'Uncategorizedtemplates', 'Unusedcategories', 'Unusedimages', 'Unusedtemplates', 'Unwatchedpages', 'Wantedcategories', 'Wantedfiles', 'Wantedpages', 'Wantedtemplates', 'Allpages', 'Prefixindex', 'Categories', 'Disambiguations', 'Listredirects', 'Userlogin', 'CreateAccount', 'Blockip', 'Ipblocklist', 'Unblock', 'Resetpass', 'DeletedContributions', 'Preferences', 'Contributions', 'Listgrouprights', 'Listusers', 'Activeusers', 'Userrights', 'Newimages', 'Log', 'Watchlist', 'Newpages', 'Recentchanges', 'Recentchangeslinked', 'Tags', 'Listfiles', 'Filepath', 'MIMEsearch', 'FileDuplicateSearch', 'Upload', 'Statistics', 'Allmessages', 'Version', 'Lockdb', 'Unlockdb', 'LinkSearch', 'Randompage', 'Randomredirect', 'Mostlinkedcategories', 'Mostimages', 'Mostlinked', 'Mostlinkedtemplates', 'Mostcategories', 'Mostrevisions', 'ComparePages', 'Export', 'Import', 'Undelete', 'Whatlinkshere', 'MergeHistory', 'Booksources', 'Blankpage', 'Blockme', 'Emailuser', 'Listadmins', 'Listbots', 'Movepage', 'Mycontributions', 'Mypage', 'Mytalk', 'Revisiondelete', 'RevisionMove', 'Specialpages', 'Userlogout'): xml.sax.parse("http://localhost/git-trunk/phase3/index.php?title=Special:" + page, h) I had to manually skip some of these for unrelated reasons, but none of them became malformed because of this commit. Also tested the main page and Special:Random a bunch of separate times. There are probably other well-formedness errors lurking, but they can be fixed as they're reported. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 97fa093b48..ed7f06de7b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -95,6 +95,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * texvc is now run via ulimit4.sh, to limit execution time. * SQLite now supports $wgSharedDB. * (bug 8507) Group file links by namespace:title on image pages +* Stop emitting named entities, so we can use while still being + well-formed XML === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/includes/Html.php b/includes/Html.php index 76abf38c15..fea5fb7aca 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -598,19 +598,7 @@ class Html { global $wgHtml5, $wgHtml5Version, $wgWellFormedXml, $wgDocType, $wgDTD; global $wgXhtmlNamespaces, $wgXhtmlDefaultNamespace; if ( $wgHtml5 ) { - if ( $wgWellFormedXml ) { - # Unknown elements and attributes are okay in XML, but unknown - # named entities are well-formedness errors and will break XML - # parsers. Thus we need a doctype that gives us appropriate - # entity definitions. The HTML5 spec permits four legacy - # doctypes as obsolete but conforming, so let's pick one of - # those, although it makes our pages look like XHTML1 Strict. - # Isn't compatibility great? - $ret .= "\n"; - } else { - # Much saner. - $ret .= "\n"; - } + $ret .= "\n"; if ( $wgHtml5Version ) { $attribs['version'] = $wgHtml5Version; }