Merge "Replace deprecated wfMsg* calls with Message class calls."
[lhc/web/wiklou.git] / includes / Title.php
index 94ae062..eccae70 100644 (file)
@@ -347,7 +347,7 @@ class Title {
         * @return Title the new object
         */
        public static function newMainPage() {
-               $title = Title::newFromText( wfMsgForContent( 'mainpage' ) );
+               $title = Title::newFromText( wfMessage( 'mainpage' )->inContentLanguage()->text() );
                // Don't give fatal errors if the message is broken
                if ( !$title ) {
                        $title = Title::newFromText( 'Main Page' );
@@ -1594,7 +1594,7 @@ class Title {
         *   queries by skipping checks for cascading protections and user blocks.
         * @param $ignoreErrors Array of Strings Set this to a list of message keys
         *   whose corresponding errors may be ignored.
-        * @return Array of arguments to wfMsg to explain permissions problems.
+        * @return Array of arguments to wfMessage to explain permissions problems.
         */
        public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) {
                $errors = $this->getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries );
@@ -1751,7 +1751,7 @@ class Title {
                # Check $wgNamespaceProtection for restricted namespaces
                if ( $this->isNamespaceProtected( $user ) ) {
                        $ns = $this->mNamespace == NS_MAIN ?
-                               wfMsg( 'nstab-main' ) : $this->getNsText();
+                               wfMessage( 'nstab-main' )->text() : $this->getNsText();
                        $errors[] = $this->mNamespace == NS_MEDIAWIKI ?
                                array( 'protectedinterface' ) : array( 'namespaceprotected',  $ns );
                }
@@ -1950,7 +1950,7 @@ class Title {
                        $id = $user->blockedBy();
                        $reason = $user->blockedFor();
                        if ( $reason == '' ) {
-                               $reason = wfMsg( 'blockednoreason' );
+                               $reason = wfMessage( 'blockednoreason' )->text();
                        }
                        $ip = $user->getRequest()->getIP();
 
@@ -2108,7 +2108,7 @@ class Title {
         * @param $user User to check
         * @param $doExpensiveQueries Bool Set this to false to avoid doing unnecessary queries.
         * @param $short Bool Set this to true to stop after the first permission error.
-        * @return Array of arrays of the arguments to wfMsg to explain permissions problems.
+        * @return Array of arrays of the arguments to wfMessage to explain permissions problems.
         */
        protected function getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries = true, $short = false ) {
                wfProfileIn( __METHOD__ );
@@ -3546,9 +3546,13 @@ class Title {
                        );
                        # Update the protection log
                        $log = new LogPage( 'protect' );
-                       $comment = wfMsgForContent( 'prot_1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
+                       $comment = wfMessage(
+                               'prot_1movedto2',
+                               $this->getPrefixedText(),
+                               $nt->getPrefixedText()
+                       )->inContentLanguage()->text();
                        if ( $reason ) {
-                               $comment .= wfMsgForContent( 'colon-separator' ) . $reason;
+                               $comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason;
                        }
                        // @todo FIXME: $params?
                        $log->addEntry( 'move_prot', $nt, $comment, array( $this->getPrefixedText() ) );
@@ -3606,7 +3610,7 @@ class Title {
                $formatter->setContext( RequestContext::newExtraneousContext( $this ) );
                $comment = $formatter->getPlainActionText();
                if ( $reason ) {
-                       $comment .= wfMsgForContent( 'colon-separator' ) . $reason;
+                       $comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason;
                }
                # Truncate for whole multibyte characters.
                $comment = $wgContLang->truncate( $comment, 255 );