* (bug 4170) Decode HTML character escapes in sort key
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 5 Dec 2005 08:19:52 +0000 (08:19 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 5 Dec 2005 08:19:52 +0000 (08:19 +0000)
RELEASE-NOTES
includes/CategoryPage.php
includes/Parser.php

index 98a77fb..2dac2a0 100644 (file)
@@ -298,6 +298,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 1850) Additional fixes so existing local and remote images
   get a blue link even if there's no local description page
 * (bug 4169) Use $wgLegalTitleChars in pipe trick conversions
+* (bug 4170) Decode HTML character escapes in sort key
 
 
 === Caveats ===
index e5c11e8..d79a463 100644 (file)
@@ -258,8 +258,8 @@ class CategoryPage extends Article {
                                        }
                                        $cont_msg = "";
                                        if ( $articles_start_char[$index] == $prev_start_char )
-                                               $cont_msg = wfMsg('listingcontinuesabbrev');
-                                       $r .= "<h3>{$articles_start_char[$index]}$cont_msg</h3>\n<ul>";
+                                               $cont_msg = wfMsgHtml('listingcontinuesabbrev');
+                                       $r .= "<h3>" . htmlspecialchars( $articles_start_char[$index] ) . "$cont_msg</h3>\n<ul>";
                                        $prev_start_char = $articles_start_char[$index];
                                }
 
@@ -284,13 +284,13 @@ class CategoryPage extends Article {
         * @access private
         */
        function shortList( $articles, $articles_start_char ) {
-               $r = '<h3>'.$articles_start_char[0]."</h3>\n";
+               $r = '<h3>' . htmlspecialchars( $articles_start_char[0] ) . "</h3>\n";
                $r .= '<ul><li>'.$articles[0].'</li>';
                for ($index = 1; $index < count($articles); $index++ )
                {
                        if ($articles_start_char[$index] != $articles_start_char[$index - 1])
                        {
-                               $r .= "</ul><h3>{$articles_start_char[$index]}</h3>\n<ul>";
+                               $r .= "</ul><h3>" . htmlspecialchars( $articles_start_char[$index] ) . "</h3>\n<ul>";
                        }
 
                        $r .= "<li>{$articles[$index]}</li>";
index 0807bd2..55d7c3c 100644 (file)
@@ -1434,6 +1434,7 @@ class Parser
                                        } else {
                                                $sortkey = $text;
                                        }
+                                       $sortkey = Sanitizer::decodeCharReferences( $sortkey );
                                        $sortkey = $wgContLang->convertCategoryKey( $sortkey );
                                        $wgLinkCache->addCategoryLinkObj( $nt, $sortkey );
                                        $this->mOutput->addCategoryLink( $t );