* (bug 2567) Fix HTML escaping on category titles in list
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 28 Jun 2005 19:56:17 +0000 (19:56 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 28 Jun 2005 19:56:17 +0000 (19:56 +0000)
RELEASE-NOTES
includes/Parser.php
languages/Language.php

index c75d9ff..9a954dd 100644 (file)
@@ -405,6 +405,7 @@ Various bugfixes, small features, and a few experimental things:
 * Fixed a bug where Special:Contributions wouldn't remember the 'invert'
   status between next/previous buttons.
 * Move MonoBook printable link from tab to sidebar
+* (bug 2567) Fix HTML escaping on category titles in list
 
 
 === Caveats ===
index 2dbc4e9..d7128c4 100644 (file)
@@ -1379,7 +1379,7 @@ class Parser
                                
                                if ( $ns == NS_CATEGORY ) {
                                        wfProfileIn( "$fname-category" );
-                                       $t = $wgContLang->convert($nt->getText());
+                                       $t = $wgContLang->convertHtml( $nt->getText() );
                                        $s = rtrim($s . "\n"); # bug 87
 
                                        $wgLinkCache->suspend(); # Don't save in links/brokenlinks
index 87b8e9c..27d3344 100644 (file)
@@ -2786,6 +2786,17 @@ class Language {
        function convert( $text, $isTitle = false) {
                return $this->mConverter->convert($text, $isTitle);
        }
+       
+       /**
+        * Perform output conversion on a string, and encode for safe HTML output.
+        * @param string $text
+        * @param bool $isTitle -- wtf?
+        * @return string
+        * @todo this should get integrated somewhere sane
+        */
+       function convertHtml( $text, $isTitle = false ) {
+               return htmlspecialchars( $this->convert( $text, $isTitle ) );
+       }
 
        function convertCategoryKey( $key ) {
                return $this->mConverter->convertCategoryKey( $key );