Index: trunk/phase3/includes/Sanitizer.php |
— | — | @@ -59,6 +59,9 @@ |
60 | 60 | /** |
61 | 61 | * List of all named character entities defined in HTML 4.01 |
62 | 62 | * 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. |
63 | 66 | * @private |
64 | 67 | */ |
65 | 68 | global $wgHtmlEntities; |
— | — | @@ -318,6 +321,7 @@ |
319 | 322 | |
320 | 323 | /** |
321 | 324 | * Character entity aliases accepted by MediaWiki |
| 325 | + * XXX: decodeEntity() assumes that all values in this array are valid keys to $wgHtmlEntities |
322 | 326 | */ |
323 | 327 | global $wgHtmlEntityAliases; |
324 | 328 | $wgHtmlEntityAliases = array( |
— | — | @@ -954,7 +958,7 @@ |
955 | 959 | * encoded text for an attribute value. |
956 | 960 | * |
957 | 961 | * See http://www.w3.org/TR/REC-xml/#AVNormalize for background, |
958 | | - * but note that we're not returning the value, but are returning |
| 962 | + * but note that we are not returning the value, but are returning |
959 | 963 | * XML source fragments that will be slapped into output. |
960 | 964 | * |
961 | 965 | * @param string $text |
— | — | @@ -1032,6 +1036,8 @@ |
1033 | 1037 | return "&{$wgHtmlEntityAliases[$name]};"; |
1034 | 1038 | } elseif( isset( $wgHtmlEntities[$name] ) ) { |
1035 | 1039 | return "&$name;"; |
| 1040 | + } elseif( $name == 'apos' ) { |
| 1041 | + return "'"; // "'" is valid in XHTML, but not in HTML4 |
1036 | 1042 | } else { |
1037 | 1043 | return "&$name;"; |
1038 | 1044 | } |
— | — | @@ -1133,6 +1139,8 @@ |
1134 | 1140 | } |
1135 | 1141 | if( isset( $wgHtmlEntities[$name] ) ) { |
1136 | 1142 | return codepointToUtf8( $wgHtmlEntities[$name] ); |
| 1143 | + } elseif( $name == 'apos' ) { |
| 1144 | + return "'"; // "'" is not in $wgHtmlEntities, but it's still valid XHTML |
1137 | 1145 | } else { |
1138 | 1146 | return "&$name;"; |
1139 | 1147 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -466,6 +466,8 @@ |
467 | 467 | local URLs |
468 | 468 | * (bug 16376) Mention in deleteBatch.php and moveBatch.php maintenance scripts |
469 | 469 | that STDIN can be used for page list |
| 470 | +* Sanitizer::decodeCharReferences() now decodes the XHTML "'" character |
| 471 | + entity (loosely related to bug 14365) |
470 | 472 | |
471 | 473 | |
472 | 474 | === API changes in 1.14 === |