Use wfMessage() instead of wfMsgGetKey()
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 4 Feb 2011 16:52:26 +0000 (16:52 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 4 Feb 2011 16:52:26 +0000 (16:52 +0000)
includes/media/MediaTransformOutput.php
includes/parser/CoreParserFunctions.php
includes/specials/SpecialAllmessages.php

index c441f06..cf706f2 100644 (file)
@@ -212,8 +212,8 @@ class MediaTransformError extends MediaTransformOutput {
                $htmlArgs = array_map( 'htmlspecialchars', $args );
                $htmlArgs = array_map( 'nl2br', $htmlArgs );
 
-               $this->htmlMsg = wfMsgReplaceArgs( htmlspecialchars( wfMsgGetKey( $msg, true ) ), $htmlArgs );
-               $this->textMsg = wfMsgReal( $msg, $args );
+               $this->htmlMsg = wfMessage( $msg )->rawParams( $htmlArgs )->escaped();
+               $this->textMsg = wfMessage( $msg )->rawParams( $htmlArgs )->text();
                $this->width = intval( $width );
                $this->height = intval( $height );
                $this->url = false;
index b76c798..88349b6 100644 (file)
@@ -86,8 +86,7 @@ class CoreParserFunctions {
        static function intFunction( $parser, $part1 = '' /*, ... */ ) {
                if ( strval( $part1 ) !== '' ) {
                        $args = array_slice( func_get_args(), 2 );
-                       $message = wfMsgGetKey( $part1, true, $parser->getOptions()->getUserLang(), false );
-                       $message = wfMsgReplaceArgs( $message, $args );
+                       $message = wfMessage( $part1, $args )->inLanguage( $parser->getOptions()->getUserLang() )->plain();
                        $message = $parser->replaceVariables( $message ); // like MessageCache::transform()
                        return $message;
                } else {
index b562ebc..fdacd80 100644 (file)
@@ -265,10 +265,12 @@ class AllmessagesTablePager extends TablePager {
                                ( $descending && ( $key < $offset || !$offset ) || !$descending && $key > $offset ) &&
                                ( ( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix === false )
                        ){
+                               $actual = wfMessage( $key )->inLanguage( $this->langcode )->plain();
+                               $default = wfMessage( $key )->inLanguage( $this->langcode )->useDatabase( false )->plain();
                                $result->result[] = array(
                                        'am_title'      => $key,
-                                       'am_actual'     => wfMsgGetKey( $key, /*useDB*/true, $this->langcode, false ),
-                                       'am_default'    => wfMsgGetKey( $key, /*useDB*/false, $this->langcode, false ),
+                                       'am_actual'     => $actual,
+                                       'am_default'    => $default,
                                        'am_customised' => $customised,
                                        'am_talk_exists' => isset( $statuses['talks'][$key] )
                                );