http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94279

Revision: 94279
Author:   robin
Date:     2011-08-11 19:58:23 +0000 (Thu, 11 Aug 2011)
Log Message:
-----------
* CategoryPage.php: fix the "category-empty" message per comment on r91518, it 
was outside the bodyContent. And do not convert interface text.
* 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/?\208?\159?\208?\190?\209?\129?\208?\181?\208?\177?\208?\189?\208?\190:?\208?\159?\208?\190?\208?\180?\208?\181?\209?\136?\208?\176?\208?\178?\208?\176?\209?\154?uselang=en
 (e.g. "Username" -> 
"?\208?\163?\209?\129?\208?\181?\209?\128?\208?\189?\208?\176?\208?\188?\208?\181")

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES-1.19
    trunk/phase3/includes/CategoryPage.php
    trunk/phase3/includes/Preferences.php
    trunk/phase3/includes/parser/Parser.php

Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19     2011-08-11 19:56:57 UTC (rev 94278)
+++ trunk/phase3/RELEASE-NOTES-1.19     2011-08-11 19:58:23 UTC (rev 94279)
@@ -40,6 +40,7 @@
   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.

Modified: trunk/phase3/includes/CategoryPage.php
===================================================================
--- trunk/phase3/includes/CategoryPage.php      2011-08-11 19:56:57 UTC (rev 
94278)
+++ trunk/phase3/includes/CategoryPage.php      2011-08-11 19:58:23 UTC (rev 
94279)
@@ -172,16 +172,16 @@
                // 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() {

Modified: trunk/phase3/includes/Preferences.php
===================================================================
--- trunk/phase3/includes/Preferences.php       2011-08-11 19:56:57 UTC (rev 
94278)
+++ trunk/phase3/includes/Preferences.php       2011-08-11 19:58:23 UTC (rev 
94279)
@@ -314,7 +314,7 @@
 
                // 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,

Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php     2011-08-11 19:56:57 UTC (rev 
94278)
+++ trunk/phase3/includes/parser/Parser.php     2011-08-11 19:58:23 UTC (rev 
94279)
@@ -362,14 +362,16 @@
                $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 @@
                                }
                                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 ) ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to