r11978 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11977‎ | r11978 | r11979 >
Date:08:19, 5 December 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 4170) Decode HTML character escapes in sort key
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -258,8 +258,8 @@
259259 }
260260 $cont_msg = "";
261261 if ( $articles_start_char[$index] == $prev_start_char )
262 - $cont_msg = wfMsg('listingcontinuesabbrev');
263 - $r .= "<h3>{$articles_start_char[$index]}$cont_msg</h3>\n<ul>";
 262+ $cont_msg = wfMsgHtml('listingcontinuesabbrev');
 263+ $r .= "<h3>" . htmlspecialchars( $articles_start_char[$index] ) . "$cont_msg</h3>\n<ul>";
264264 $prev_start_char = $articles_start_char[$index];
265265 }
266266
@@ -284,13 +284,13 @@
285285 * @access private
286286 */
287287 function shortList( $articles, $articles_start_char ) {
288 - $r = '<h3>'.$articles_start_char[0]."</h3>\n";
 288+ $r = '<h3>' . htmlspecialchars( $articles_start_char[0] ) . "</h3>\n";
289289 $r .= '<ul><li>'.$articles[0].'</li>';
290290 for ($index = 1; $index < count($articles); $index++ )
291291 {
292292 if ($articles_start_char[$index] != $articles_start_char[$index - 1])
293293 {
294 - $r .= "</ul><h3>{$articles_start_char[$index]}</h3>\n<ul>";
 294+ $r .= "</ul><h3>" . htmlspecialchars( $articles_start_char[$index] ) . "</h3>\n<ul>";
295295 }
296296
297297 $r .= "<li>{$articles[$index]}</li>";
Index: trunk/phase3/includes/Parser.php
@@ -1434,6 +1434,7 @@
14351435 } else {
14361436 $sortkey = $text;
14371437 }
 1438+ $sortkey = Sanitizer::decodeCharReferences( $sortkey );
14381439 $sortkey = $wgContLang->convertCategoryKey( $sortkey );
14391440 $wgLinkCache->addCategoryLinkObj( $nt, $sortkey );
14401441 $this->mOutput->addCategoryLink( $t );
Index: trunk/phase3/RELEASE-NOTES
@@ -298,6 +298,7 @@
299299 * (bug 1850) Additional fixes so existing local and remote images
300300 get a blue link even if there's no local description page
301301 * (bug 4169) Use $wgLegalTitleChars in pipe trick conversions
 302+* (bug 4170) Decode HTML character escapes in sort key
302303
303304
304305 === Caveats ===

Status & tagging log