* CategoryPage.php: fix the "category-empty" message per comment on r91518, it was...
authorRobin Pepermans <robin@users.mediawiki.org>
Thu, 11 Aug 2011 19:58:23 +0000 (19:58 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Thu, 11 Aug 2011 19:58:23 +0000 (19:58 +0000)
* Parser.php: Apparently that was a much bigger bug: do not convert interface text going through the parser either.
* Preferences.php: Do not convert the user signature.
For this bug in action, see e.g. http://sr.wikipedia.org/sr-ec/Посебно:Подешавањ?uselang=en (e.g. "Username" -> "Усернаме")

RELEASE-NOTES-1.19
includes/CategoryPage.php
includes/Preferences.php
includes/parser/Parser.php

index 86fcf35..90b85b1 100644 (file)
@@ -40,6 +40,7 @@ production.
   when the function exists but is disabled. Introduced Maintenance::posix_isatty()
 * (bug 30264) Changed installer-generated LocalSettings.php to use require_once()
   instead require() for included extensions.
+* Do not convert text in the user interface language to another script.
 
 === API changes in 1.19 ===
 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
index 850256f..42b06a3 100644 (file)
@@ -172,16 +172,16 @@ class CategoryViewer {
                // Give a proper message if category is empty
                if ( $r == '' ) {
                        $r = wfMsgExt( 'category-empty', array( 'parse' ) );
+               } else {
+                       $pageLang = $this->title->getPageLanguage();
+                       $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() );
+                       # close the previous div, show the headings in user language,
+                       # then open a new div with the page content language again
+                       $r = '</div>' . $r . Html::openElement( 'div', $langAttribs );
                }
 
-               $pageLang = $this->title->getPageLanguage();
-               $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() );
-               # close the previous div, show the headings in user language,
-               # then open a new div with the page content language again
-               $r = '</div>' . $r . Html::openElement( 'div', $langAttribs );
-
                wfProfileOut( __METHOD__ );
-               return $wgContLang->convert( $r );
+               return $r;
        }
 
        function clearCategoryState() {
index d33822b..0c8bf29 100644 (file)
@@ -314,7 +314,7 @@ class Preferences {
 
                // show a preview of the old signature first
                $oldsigWikiText = $wgParser->preSaveTransform( "~~~", new Title, $user, new ParserOptions );
-               $oldsigHTML = $wgOut->parseInline( $oldsigWikiText );
+               $oldsigHTML = $wgOut->parseInline( $oldsigWikiText, true, true );
                $defaultPreferences['oldsig'] = array(
                        'type' => 'info',
                        'raw' => true,
index 714d9d3..7b70362 100644 (file)
@@ -362,14 +362,16 @@ class Parser {
                $this->replaceLinkHolders( $text );
 
                /**
-                * The page doesn't get language converted if
+                * The input doesn't get language converted if
                 * a) It's disabled
                 * b) Content isn't converted
                 * c) It's a conversion table
+                * d) it is an interface message (which is in the user language)
                 */
                if ( !( $wgDisableLangConversion
                                || isset( $this->mDoubleUnderscores['nocontentconvert'] )
-                               || $this->mTitle->isConversionTable() ) ) {
+                               || $this->mTitle->isConversionTable()
+                               || $this->mOptions->getInterfaceMessage() ) ) {
 
                        # The position of the convert() call should not be changed. it
                        # assumes that the links are all replaced and the only thing left
@@ -1996,6 +1998,15 @@ class Parser {
                                }
                                wfProfileOut( __METHOD__."-interwiki" );
 
+                               # Interprojects
+                               wfProfileIn( __METHOD__."-interproject" );
+                               global $wgInterProjectLinks;
+                               if ( is_array( $wgInterProjectLinks ) && isset( $wgInterProjectLinks[$iw] ) && $nottalk ) {
+                                       $this->mOutput->addInterProjectLink( $iw, $nt, ( $wasblank ? '' : $text ) );
+                                       wfProfileOut( __METHOD__."-interproject" );
+                               }
+                               wfProfileOut( __METHOD__."-interproject" );
+
                                if ( $ns == NS_FILE ) {
                                        wfProfileIn( __METHOD__."-image" );
                                        if ( !wfIsBadImage( $nt->getDBkey(), $this->mTitle ) ) {