r45477 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45476‎ | r45477 | r45478 >
Date:02:31, 7 January 2009
Author:brion
Status:ok
Tags:
Comment:
Revert r45387 "Add special case handling of the XHTML character entity "'" to normalizeEntity() and decodeEntity(). This should resolve the remainder of bug 14365.
It might seem cleaner to just add the appropriate entry to $wgHtmlEntityAliases, but this would break decodeEntity() as currently written. Explicitly note this in the comments."

This doesn't make any sense. Is there any reason not to just add apos to $wgHtmlEntities if it's valid XHTML?
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Sanitizer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Sanitizer.php
@@ -59,9 +59,6 @@
6060 /**
6161 * List of all named character entities defined in HTML 4.01
6262 * http://www.w3.org/TR/html4/sgml/entities.html
63 - * This list does *not* include ', which is part of XHTML
64 - * 1.0 but not HTML 4.01. It is handled as a special case in
65 - * the code.
6663 * @private
6764 */
6865 global $wgHtmlEntities;
@@ -321,7 +318,6 @@
322319
323320 /**
324321 * Character entity aliases accepted by MediaWiki
325 - * XXX: decodeEntity() assumes that all values in this array are valid keys to $wgHtmlEntities
326322 */
327323 global $wgHtmlEntityAliases;
328324 $wgHtmlEntityAliases = array(
@@ -951,7 +947,7 @@
952948 * encoded text for an attribute value.
953949 *
954950 * See http://www.w3.org/TR/REC-xml/#AVNormalize for background,
955 - * but note that we are not returning the value, but are returning
 951+ * but note that we're not returning the value, but are returning
956952 * XML source fragments that will be slapped into output.
957953 *
958954 * @param string $text
@@ -1029,8 +1025,6 @@
10301026 return "&{$wgHtmlEntityAliases[$name]};";
10311027 } elseif( isset( $wgHtmlEntities[$name] ) ) {
10321028 return "&$name;";
1033 - } elseif( $name == 'apos' ) {
1034 - return "'"; // "'" is valid in XHTML, but not in HTML4
10351029 } else {
10361030 return "&$name;";
10371031 }
@@ -1132,8 +1126,6 @@
11331127 }
11341128 if( isset( $wgHtmlEntities[$name] ) ) {
11351129 return codepointToUtf8( $wgHtmlEntities[$name] );
1136 - } elseif( $name == 'apos' ) {
1137 - return "'"; // "'" is not in $wgHtmlEntities, but it's still valid XHTML
11381130 } else {
11391131 return "&$name;";
11401132 }
Index: trunk/phase3/RELEASE-NOTES
@@ -470,8 +470,6 @@
471471 local URLs
472472 * (bug 16376) Mention in deleteBatch.php and moveBatch.php maintenance scripts
473473 that STDIN can be used for page list
474 -* Sanitizer::decodeCharReferences() now decodes the XHTML "'" character
475 - entity (loosely related to bug 14365)
476474 * (bug 16560) Special:Random returns a page from ContentNamespaces, and no
477475 longer from NS_MAIN
478476

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r44370(bug 14365) skip invalid titles in RepoGroup::findFiles()vyznev23:20, 9 December 2008
r45387Add special case handling of the XHTML character entity "'" to normalize...vyznev02:29, 4 January 2009

Status & tagging log