Replace deprecated wfMsg* calls with Message class calls.
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Tue, 21 Aug 2012 19:58:47 +0000 (21:58 +0200)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Tue, 21 Aug 2012 19:58:47 +0000 (21:58 +0200)
Doing this in steps of roughly 100 changes per commit, so that it remains
reviewable. This should be the one but last change set with the "easy"
ones for core.

Change-Id: If894a92dd65b2f5f4f096b9133685eb3b067a1d8

14 files changed:
includes/api/ApiParse.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryProtectedTitles.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/installer/DatabaseInstaller.php
includes/installer/Installer.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerOutput.php
includes/installer/WebInstallerPage.php
includes/job/UploadFromUrlJob.php
skins/CologneBlue.php
skins/Nostalgia.php
skins/Standard.php

index 8aac2f4..c63ae8a 100644 (file)
@@ -425,7 +425,7 @@ class ApiParse extends ApiBase {
                                $text == '' ? $l : $text );
                }
 
-               $s .= implode( htmlspecialchars( wfMsgExt( 'pipe-separator', 'escapenoentities' ) ), $langs );
+               $s .= implode( wfMessage( 'pipe-separator' )->escaped(), $langs );
 
                if ( $wgContLang->isRTL() ) {
                        $s = Html::rawElement( 'span', array( 'dir' => "LTR" ), $s );
index bc514b3..f2fd425 100644 (file)
@@ -359,7 +359,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
 
        public function getCacheMode( $params ) {
                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
-                       // formatComment() calls wfMsg() among other things
+                       // formatComment() calls wfMessage() among other things
                        return 'anon-public-user-private';
                } else {
                        return 'public';
index 5e270e0..14aed28 100644 (file)
@@ -139,7 +139,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
 
        public function getCacheMode( $params ) {
                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
-                       // formatComment() calls wfMsg() among other things
+                       // formatComment() calls wfMessage() among other things
                        return 'anon-public-user-private';
                } else {
                        return 'public';
index 7bb6bc5..7ae4f37 100644 (file)
@@ -503,7 +503,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                        return 'private';
                }
                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
-                       // formatComment() calls wfMsg() among other things
+                       // formatComment() calls wfMessage() among other things
                        return 'anon-public-user-private';
                }
                return 'public';
index 18a6cd4..b89a8ea 100644 (file)
@@ -548,7 +548,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                        return 'private';
                }
                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
-                       // formatComment() calls wfMsg() among other things
+                       // formatComment() calls wfMessage() among other things
                        return 'anon-public-user-private';
                }
                return 'public';
index 0beedfa..de59b2d 100644 (file)
@@ -334,7 +334,7 @@ abstract class DatabaseInstaller {
         * @return String
         */
        public function getReadableName() {
-               return wfMsg( 'config-type-' . $this->getName() );
+               return wfMessage( 'config-type-' . $this->getName() )->text();
        }
 
        /**
@@ -509,7 +509,7 @@ abstract class DatabaseInstaller {
        public function getInstallUserBox() {
                return
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-install-account' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-install-account' )->text() ) .
                        $this->getTextBox( '_InstallUser', 'config-db-username', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-install-username' ) ) .
                        $this->getPasswordBox( '_InstallPassword', 'config-db-password', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-install-password' ) ) .
                        Html::closeElement( 'fieldset' );
@@ -534,7 +534,7 @@ abstract class DatabaseInstaller {
        public function getWebUserBox( $noCreateMsg = false ) {
                $wrapperStyle = $this->getVar( '_SameAccount' ) ? 'display: none' : '';
                $s = Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-web-account' )->text() ) .
                        $this->getCheckBox(
                                '_SameAccount', 'config-db-web-account-same',
                                array( 'class' => 'hideShowRadio', 'rel' => 'dbOtherAccount' )
@@ -544,7 +544,7 @@ abstract class DatabaseInstaller {
                        $this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) .
                        $this->parent->getHelpBox( 'config-db-web-help' );
                if ( $noCreateMsg ) {
-                       $s .= $this->parent->getWarningBox( wfMsgNoTrans( $noCreateMsg ) );
+                       $s .= $this->parent->getWarningBox( wfMessage( $noCreateMsg )->plain() );
                } else {
                        $s .= $this->getCheckBox( '_CreateDBAccount', 'config-db-web-create' );
                }
index d87f294..cbede1e 100644 (file)
@@ -308,7 +308,7 @@ abstract class Installer {
 
        /**
         * UI interface for displaying a short message
-        * The parameters are like parameters to wfMsg().
+        * The parameters are like parameters to wfMessage().
         * The messages will be in wikitext format, which will be converted to an
         * output format such as HTML or text before being sent to the user.
         * @param $msg
@@ -645,7 +645,7 @@ abstract class Installer {
                $allNames = array();
 
                foreach ( self::getDBTypes() as $name ) {
-                       $allNames[] = wfMsg( "config-type-$name" );
+                       $allNames[] = wfMessage( "config-type-$name" )->text();
                }
 
                // cache initially available databases to make sure that everything will be displayed correctly
@@ -1585,12 +1585,13 @@ abstract class Installer {
                $status = Status::newGood();
                try {
                        $page = WikiPage::factory( Title::newMainPage() );
-                       $page->doEdit( wfMsgForContent( 'mainpagetext' ) . "\n\n" .
-                                                       wfMsgForContent( 'mainpagedocfooter' ),
-                                                       '',
-                                                       EDIT_NEW,
-                                                       false,
-                                                       User::newFromName( 'MediaWiki default' ) );
+                       $page->doEdit( wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
+                                       wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text(),
+                                       '',
+                                       EDIT_NEW,
+                                       false,
+                                       User::newFromName( 'MediaWiki default' )
+                       );
                } catch (MWException $e) {
                        //using raw, because $wgShowExceptionDetails can not be set yet
                        $status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
index 4f31195..e1c5c29 100644 (file)
@@ -369,7 +369,7 @@ class WebInstaller extends Installer {
        }
 
        /**
-        * Show an error message in a box. Parameters are like wfMsg().
+        * Show an error message in a box. Parameters are like wfMessage().
         * @param $msg
         */
        public function showError( $msg /*...*/ ) {
@@ -540,7 +540,7 @@ class WebInstaller extends Installer {
                $s .= $this->getPageListItem( 'Restart', true, $currentPageName );
                $s .= "</ul></div>\n"; // end list pane
                $s .= Html::element( 'h2', array(),
-                               wfMsg( 'config-page-' . strtolower( $currentPageName ) ) );
+                       wfMessage( 'config-page-' . strtolower( $currentPageName ) )->text() );
 
                $this->output->addHTMLNoFlush( $s );
        }
@@ -556,7 +556,7 @@ class WebInstaller extends Installer {
         */
        private function getPageListItem( $pageName, $enabled, $currentPageName ) {
                $s = "<li class=\"config-page-list-item\">";
-               $name = wfMsg( 'config-page-' . strtolower( $pageName ) );
+               $name = wfMessage( 'config-page-' . strtolower( $pageName ) )->text();
 
                if ( $enabled ) {
                        $query = array( 'page' => $pageName );
@@ -609,7 +609,7 @@ class WebInstaller extends Installer {
        /**
         * Get HTML for an error box with an icon.
         *
-        * @param $text String: wikitext, get this with wfMsgNoTrans()
+        * @param $text String: wikitext, get this with wfMessage()->plain()
         *
         * @return string
         */
@@ -620,7 +620,7 @@ class WebInstaller extends Installer {
        /**
         * Get HTML for a warning box with an icon.
         *
-        * @param $text String: wikitext, get this with wfMsgNoTrans()
+        * @param $text String: wikitext, get this with wfMessage()->plain()
         *
         * @return string
         */
@@ -631,7 +631,7 @@ class WebInstaller extends Installer {
        /**
         * Get HTML for an info box with an icon.
         *
-        * @param $text String: wikitext, get this with wfMsgNoTrans()
+        * @param $text String: wikitext, get this with wfMessage()->plain()
         * @param $icon String: icon name, file in skins/common/images
         * @param $class String: additional class name to add to the wrapper div
         *
@@ -640,13 +640,13 @@ class WebInstaller extends Installer {
        public function getInfoBox( $text, $icon = false, $class = false ) {
                $text = $this->parse( $text, true );
                $icon = ( $icon == false ) ? '../skins/common/images/info-32.png' : '../skins/common/images/'.$icon;
-               $alt = wfMsg( 'config-information' );
+               $alt = wfMessage( 'config-information' )->text();
                return Html::infoBox( $text, $icon, $alt, $class, false );
        }
 
        /**
         * Get small text indented help for a preceding form field.
-        * Parameters like wfMsg().
+        * Parameters like wfMessage().
         *
         * @param $msg
         * @return string
@@ -659,14 +659,15 @@ class WebInstaller extends Installer {
                $html = $this->parse( $text, true );
 
                return "<div class=\"mw-help-field-container\">\n" .
-                       "<span class=\"mw-help-field-hint\">" . wfMsgHtml( 'config-help' ) . "</span>\n" .
+                       "<span class=\"mw-help-field-hint\">" . wfMessage( 'config-help' )->escaped() .
+                       "</span>\n" .
                        "<span class=\"mw-help-field-data\">" . $html . "</span>\n" .
                        "</div>\n";
        }
 
        /**
         * Output a help box.
-        * @param $msg String key for wfMsg()
+        * @param $msg String key for wfMessage()
         */
        public function showHelpBox( $msg /*, ... */ ) {
                $args = func_get_args();
@@ -713,7 +714,7 @@ class WebInstaller extends Installer {
                if ( strval( $msg ) == '' ) {
                        $labelText = '&#160;';
                } else {
-                       $labelText = wfMsgHtml( $msg );
+                       $labelText = wfMessage( $msg )->escaped();
                }
 
                $attributes = array( 'class' => 'config-label' );
@@ -893,7 +894,7 @@ class WebInstaller extends Installer {
                if( isset( $params['rawtext'] ) ) {
                        $labelText = $params['rawtext'];
                } else {
-                       $labelText = $this->parse( wfMsg( $params['label'] ) );
+                       $labelText = $this->parse( wfMessage( $params['label'] )->text() );
                }
 
                return
@@ -969,7 +970,7 @@ class WebInstaller extends Installer {
                                Xml::radio( $params['controlName'], $value, $checked, $itemAttribs ) .
                                '&#160;' .
                                Xml::tags( 'label', array( 'for' => $id ), $this->parse(
-                                       wfMsgNoTrans( $params['itemLabelPrefix'] . strtolower( $value ) )
+                                       wfMessage( $params['itemLabelPrefix'] . strtolower( $value ) )->plain()
                                ) ) .
                                "</li>\n";
                }
@@ -1077,7 +1078,7 @@ class WebInstaller extends Installer {
                ) );
                $anchor = Html::rawElement( 'a',
                        array( 'href' => $this->getURL( array( 'localsettings' => 1 ) ) ),
-                       $img . ' ' . wfMsgHtml( 'config-download-localsettings' ) );
+                       $img . ' ' . wfMessage( 'config-download-localsettings' )->escaped() );
                return Html::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor );
        }
 
index 84d115b..9a516a6 100644 (file)
@@ -273,7 +273,7 @@ class WebInstallerOutput {
        </div>
        <div class="portal"><div class="body">
 <?php
-       echo $this->parent->parse( wfMsgNoTrans( 'config-sidebar' ), true );
+       echo $this->parent->parse( wfMessage( 'config-sidebar' )->plain(), true );
 ?>
        </div></div>
 </div>
@@ -301,7 +301,7 @@ class WebInstallerOutput {
 
        public function outputTitle() {
                global $wgVersion;
-               echo htmlspecialchars( wfMsg( 'config-title', $wgVersion ) );
+               echo wfMessage( 'config-title', $wgVersion )->escaped();
        }
 
        public function getJQuery() {
index 917a59a..a7ec2df 100644 (file)
@@ -84,13 +84,13 @@ abstract class WebInstallerPage {
 
                if ( $continue ) {
                        // Fake submit button for enter keypress (bug 26267)
-                       $s .= Xml::submitButton( wfMsg( "config-$continue" ),
+                       $s .= Xml::submitButton( wfMessage( "config-$continue" )->text(),
                                array( 'name' => "enter-$continue", 'style' =>
                                        'visibility:hidden;overflow:hidden;width:1px;margin:0' ) ) . "\n";
                }
 
                if ( $back ) {
-                       $s .= Xml::submitButton( wfMsg( "config-$back" ),
+                       $s .= Xml::submitButton( wfMessage( "config-$back" )->text(),
                                array(
                                        'name' => "submit-$back",
                                        'tabindex' => $this->parent->nextTabIndex()
@@ -98,7 +98,7 @@ abstract class WebInstallerPage {
                }
 
                if ( $continue ) {
-                       $s .= Xml::submitButton( wfMsg( "config-$continue" ),
+                       $s .= Xml::submitButton( wfMessage( "config-$continue" )->text(),
                                array(
                                        'name' => "submit-$continue",
                                        'tabindex' => $this->parent->nextTabIndex(),
@@ -133,7 +133,7 @@ abstract class WebInstallerPage {
         * @return string
         */
        protected function getFieldsetStart( $legend ) {
-               return "\n<fieldset><legend>" . wfMsgHtml( $legend ) . "</legend>\n";
+               return "\n<fieldset><legend>" . wfMessage( $legend )->escaped() . "</legend>\n";
        }
 
        /**
@@ -295,8 +295,8 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
                        }
                        $this->startForm();
                        $this->addHTML( $this->parent->getInfoBox(
-                               wfMsgNoTrans( 'config-upgrade-key-missing',
-                                       "<pre dir=\"ltr\">\$wgUpgradeKey = '" . $this->getVar( 'wgUpgradeKey' ) . "';</pre>" )
+                               wfMessage( 'config-upgrade-key-missing', "<pre dir=\"ltr\">\$wgUpgradeKey = '" .
+                                       $this->getVar( 'wgUpgradeKey' ) . "';</pre>" )->plain()
                        ) );
                        $this->endForm( 'continue' );
                        return 'output';
@@ -333,7 +333,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
        protected function showKeyForm() {
                $this->startForm();
                $this->addHTML(
-                       $this->parent->getInfoBox( wfMsgNoTrans( 'config-localsettings-upgrade' ) ).
+                       $this->parent->getInfoBox( wfMessage( 'config-localsettings-upgrade' )->plain() ).
                        '<br />' .
                        $this->parent->getTextBox( array(
                                'var' => 'wgUpgradeKey',
@@ -410,13 +410,13 @@ class WebInstaller_Welcome extends WebInstallerPage {
                                return 'continue';
                        }
                }
-               $this->parent->output->addWikiText( wfMsgNoTrans( 'config-welcome' ) );
+               $this->parent->output->addWikiText( wfMessage( 'config-welcome' )->plain() );
                $status = $this->parent->doEnvironmentChecks();
                if ( $status->isGood() ) {
                        $this->parent->output->addHTML( '<span class="success-message">' .
-                               wfMsgHtml( 'config-env-good' ) . '</span>' );
-                       $this->parent->output->addWikiText( wfMsgNoTrans( 'config-copyright',
-                               SpecialVersion::getCopyrightAndAuthorList() ) );
+                               wfMessage( 'config-env-good' )->escaped() . '</span>' );
+                       $this->parent->output->addWikiText( wfMessage( 'config-copyright',
+                               SpecialVersion::getCopyrightAndAuthorList() )->plain() );
                        $this->startForm();
                        $this->endForm();
                } else {
@@ -454,10 +454,10 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                $dbSupport = '';
                foreach( $this->parent->getDBTypes() as $type ) {
                        $link = DatabaseBase::factory( $type )->getSoftwareLink();
-                       $dbSupport .= wfMsgNoTrans( "config-support-$type", $link ) . "\n";
+                       $dbSupport .= wfMessage( "config-support-$type", $link )->plain() . "\n";
                }
                $this->addHTML( $this->parent->getInfoBox(
-                       wfMsg( 'config-support-info', trim( $dbSupport ) ) ) );
+                       wfMessage( 'config-support-info', trim( $dbSupport ) )->text() ) );
 
                foreach ( $this->parent->getVar( '_CompiledDBs' ) as $type ) {
                        $installer = $this->parent->getDBInstaller( $type );
@@ -476,7 +476,7 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                        $settings .=
                                Html::openElement( 'div', array( 'id' => 'DB_wrapper_' . $type,
                                                'class' => 'dbWrapper' ) ) .
-                               Html::element( 'h3', array(), wfMsg( 'config-header-' . $type ) ) .
+                               Html::element( 'h3', array(), wfMessage( 'config-header-' . $type )->text() ) .
                                $installer->getConnectForm() .
                                "</div>\n";
                }
@@ -555,7 +555,7 @@ class WebInstaller_Upgrade extends WebInstallerPage {
 
                $this->startForm();
                $this->addHTML( $this->parent->getInfoBox(
-                       wfMsgNoTrans( 'config-can-upgrade', $GLOBALS['wgVersion'] ) ) );
+                       wfMessage( 'config-can-upgrade', $GLOBALS['wgVersion'] )->plain() ) );
                $this->endForm();
        }
 
@@ -570,11 +570,11 @@ class WebInstaller_Upgrade extends WebInstallerPage {
                $this->parent->disableLinkPopups();
                $this->addHTML(
                        $this->parent->getInfoBox(
-                               wfMsgNoTrans( $msg,
+                               wfMessage( $msg,
                                        $this->getVar( 'wgServer' ) .
                                                $this->getVar( 'wgScriptPath' ) . '/index' .
                                                $this->getVar( 'wgScriptExtension' )
-                               ), 'tick-32.png'
+                               )->plain(), 'tick-32.png'
                        )
                );
                $this->parent->restoreLinkPopups();
@@ -635,7 +635,10 @@ class WebInstaller_Name extends WebInstallerPage {
                // Set wgMetaNamespace to something valid before we show the form.
                // $wgMetaNamespace defaults to $wgSiteName which is 'MediaWiki'
                $metaNS = $this->getVar( 'wgMetaNamespace' );
-               $this->setVar( 'wgMetaNamespace', wfMsgForContent( 'config-ns-other-default' ) );
+               $this->setVar(
+                       'wgMetaNamespace',
+                       wfMessage( 'config-ns-other-default' )->inContentLanguage()->text()
+               );
 
                $this->addHTML(
                        $this->parent->getTextBox( array(
@@ -683,7 +686,7 @@ class WebInstaller_Name extends WebInstallerPage {
                                'help' => $this->parent->getHelpBox( 'config-subscribe-help' )
                        ) ) .
                        $this->getFieldSetEnd() .
-                       $this->parent->getInfoBox( wfMsg( 'config-almost-done' ) ) .
+                       $this->parent->getInfoBox( wfMessage( 'config-almost-done' )->text() ) .
                        $this->parent->getRadioSet( array(
                                'var' => '_SkipOptional',
                                'itemLabelPrefix' => 'config-optional-',
@@ -721,7 +724,7 @@ class WebInstaller_Name extends WebInstallerPage {
                        $name = preg_replace( '/__+/', '_', $name );
                        $name = ucfirst( trim( $name, '_' ) );
                } elseif ( $nsType == 'generic' ) {
-                       $name = wfMsg( 'config-ns-generic' );
+                       $name = wfMessage( 'config-ns-generic' )->text();
                } else { // other
                        $name = $this->getVar( 'wgMetaNamespace' );
                }
@@ -833,7 +836,7 @@ class WebInstaller_Options extends WebInstallerPage {
                                'itemLabelPrefix' => 'config-profile-',
                                'values' => array_keys( $this->parent->rightsProfiles ),
                        ) ) .
-                       $this->parent->getInfoBox( wfMsgNoTrans( 'config-profile-help' ) ) .
+                       $this->parent->getInfoBox( wfMessage( 'config-profile-help' )->plain() ) .
 
                        # Licensing
                        $this->parent->getRadioSet( array(
@@ -1046,7 +1049,7 @@ class WebInstaller_Options extends WebInstallerPage {
                                        'href' => $this->getCCPartnerUrl(),
                                        'onclick' => $expandJs,
                                ),
-                               wfMsg( 'config-cc-again' )
+                               wfMessage( 'config-cc-again' )->text()
                        ) .
                        "</p>\n" .
                        "<script type=\"text/javascript\">\n" .
@@ -1092,7 +1095,7 @@ class WebInstaller_Options extends WebInstallerPage {
                        if ( isset( $entry['text'] ) ) {
                                $this->setVar( 'wgRightsText', $entry['text'] );
                        } else {
-                               $this->setVar( 'wgRightsText', wfMsg( 'config-license-' . $code ) );
+                               $this->setVar( 'wgRightsText', wfMessage( 'config-license-' . $code )->text() );
                        }
                        $this->setVar( 'wgRightsUrl', $entry['url'] );
                        $this->setVar( 'wgRightsIcon', $entry['icon'] );
@@ -1165,14 +1168,14 @@ class WebInstaller_Install extends WebInstallerPage {
                        $this->endForm( $continue, $back );
                } else {
                        $this->startForm();
-                       $this->addHTML( $this->parent->getInfoBox( wfMsgNoTrans( 'config-install-begin' ) ) );
+                       $this->addHTML( $this->parent->getInfoBox( wfMessage( 'config-install-begin' )->plain() ) );
                        $this->endForm();
                }
                return true;
        }
 
        public function startStage( $step ) {
-               $this->addHTML( "<li>" . wfMsgHtml( "config-install-$step" ) . wfMsg( 'ellipsis') );
+               $this->addHTML( "<li>" . wfMessage( "config-install-$step" )->escaped() . wfMessage( 'ellipsis')->escaped() );
                if ( $step == 'extension-tables' ) {
                        $this->startLiveBox();
                }
@@ -1187,7 +1190,7 @@ class WebInstaller_Install extends WebInstallerPage {
                        $this->endLiveBox();
                }
                $msg = $status->isOk() ? 'config-install-step-done' : 'config-install-step-failed';
-               $html = wfMsgHtml( 'word-separator' ) . wfMsgHtml( $msg );
+               $html = wfMessage( 'word-separator' )->escaped() . wfMessage( $msg )->escaped();
                if ( !$status->isOk() ) {
                        $html = "<span class=\"error\">$html</span>";
                }
@@ -1219,13 +1222,13 @@ class WebInstaller_Complete extends WebInstallerPage {
                $this->parent->disableLinkPopups();
                $this->addHTML(
                        $this->parent->getInfoBox(
-                               wfMsgNoTrans( 'config-install-done',
+                               wfMessage( 'config-install-done',
                                        $lsUrl,
                                        $this->getVar( 'wgServer' ) .
                                                $this->getVar( 'wgScriptPath' ) . '/index' .
                                                $this->getVar( 'wgScriptExtension' ),
                                        '<downloadlink/>'
-                               ), 'tick-32.png'
+                               )->plain(), 'tick-32.png'
                        )
                );
                $this->parent->restoreLinkPopups();
@@ -1246,7 +1249,7 @@ class WebInstaller_Restart extends WebInstallerPage {
                }
 
                $this->startForm();
-               $s = $this->parent->getWarningBox( wfMsgNoTrans( 'config-help-restart' ) );
+               $s = $this->parent->getWarningBox( wfMessage( 'config-help-restart' )->plain() );
                $this->addHTML( $s );
                $this->endForm( 'restart' );
        }
@@ -1268,7 +1271,7 @@ abstract class WebInstaller_Document extends WebInstallerPage {
        public function getFileContents() {
                $file = dirname( __FILE__ ) . '/../../' . $this->getFileName();
                if( ! file_exists( $file ) ) {
-                       return wfMsgNoTrans( 'config-nofile', $file );
+                       return wfMessage( 'config-nofile', $file )->plain();
                }
                return file_get_contents( $file );
        }
index 55ccc27..e06f68e 100644 (file)
@@ -82,10 +82,10 @@ class UploadFromUrlJob extends Job {
 
                                if ( $this->params['leaveMessage'] ) {
                                        $this->user->leaveUserMessage(
-                                               wfMsg( 'upload-warning-subj' ),
-                                               wfMsg( 'upload-warning-msg',
+                                               wfMessage( 'upload-warning-subj' )->text(),
+                                               wfMessage( 'upload-warning-msg',
                                                        $key,
-                                                       $this->params['url'] )
+                                                       $this->params['url'] )->text()
                                        );
                                } else {
                                        wfSetupSession( $this->params['sessionId'] );
@@ -119,17 +119,17 @@ class UploadFromUrlJob extends Job {
        protected function leaveMessage( $status ) {
                if ( $this->params['leaveMessage'] ) {
                        if ( $status->isGood() ) {
-                               $this->user->leaveUserMessage( wfMsg( 'upload-success-subj' ),
-                                       wfMsg( 'upload-success-msg',
+                               $this->user->leaveUserMessage( wfMessage( 'upload-success-subj' )->text(),
+                                       wfMessage( 'upload-success-msg',
                                                $this->upload->getTitle()->getText(),
                                                $this->params['url']
-                                       ) );
+                                       )->text() );
                        } else {
-                               $this->user->leaveUserMessage( wfMsg( 'upload-failure-subj' ),
-                                       wfMsg( 'upload-failure-msg',
+                               $this->user->leaveUserMessage( wfMessage( 'upload-failure-subj' )->text(),
+                                       wfMessage( 'upload-failure-msg',
                                                $status->getWikiText(),
                                                $this->params['url']
-                                       ) );
+                                       )->text() );
                        }
                } else {
                        wfSetupSession( $this->params['sessionId'] );
index 214d9bc..bfcb31e 100644 (file)
@@ -84,14 +84,14 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                $s .= '<td class="top" nowrap="nowrap">';
                $s .= '<a href="' . htmlspecialchars( $mainPageObj->getLocalURL() ) . '">';
-               $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>';
+               $s .= '<span id="sitetitle">' . wfMessage( 'sitetitle' )->escaped() . '</span></a>';
 
                $s .= '</td><td class="top" id="top-syslinks" width="100%">';
                $s .= $this->sysLinks();
                $s .= '</td></tr><tr><td class="top-subheader">';
 
                $s .= '<font size="-1"><span id="sitesub">';
-               $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>';
+               $s .= wfMessage( 'sitesubtitle' )->escaped() . '</span></font>';
                $s .= '</td><td class="top-linkcollection">';
 
                $s .= '<font size="-1"><span id="langlinks">';
@@ -128,15 +128,11 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                $s .= $this->bottomLinks();
                $s .= $this->getSkin()->getLanguage()->pipeList( array(
-                       "\n<br />" . Linker::link(
-                               Title::newMainPage(),
-                               null,
-                               array(),
-                               array(),
-                               array( 'known', 'noclasses' )
+                       "\n<br />" . Linker::linkKnown(
+                               Title::newMainPage()
                        ),
                        $this->getSkin()->aboutLink(),
-                       $this->searchForm( wfMsg( 'qbfind' ) )
+                       $this->searchForm( wfMessage( 'qbfind' )->text() )
                ) );
 
                $s .= "\n<br />" . $this->pageStats();
@@ -167,16 +163,16 @@ class CologneBlueTemplate extends LegacyTemplate {
                $s = array(
                        $this->getSkin()->mainPageLink(),
                        Linker::linkKnown(
-                               Title::newFromText( wfMsgForContent( 'aboutpage' ) ),
-                               wfMsg( 'about' )
+                               Title::newFromText( wfMessage( 'aboutpage' )->inContentLanguage()->text() ),
+                               wfMessage( 'about' )->text()
                        ),
                        Linker::linkKnown(
-                               Title::newFromText( wfMsgForContent( 'helppage' ) ),
-                               wfMsg( 'help' )
+                               Title::newFromText( wfMessage( 'helppage' )->inContentLanguage()->text() ),
+                               wfMessage( 'help' )->text()
                        ),
                        Linker::linkKnown(
-                               Title::newFromText( wfMsgForContent( 'faqpage' ) ),
-                               wfMsg( 'faq' )
+                               Title::newFromText( wfMessage( 'faqpage' )->inContentLanguage()->text() ),
+                               wfMessage( 'faq' )->text()
                        ),
                        Linker::specialLink( 'Specialpages' )
                );
@@ -191,14 +187,14 @@ class CologneBlueTemplate extends LegacyTemplate {
                if ( $this->data['loggedin'] ) {
                        $s[] = Linker::linkKnown(
                                $lo,
-                               wfMsg( 'logout' ),
+                               wfMessage( 'logout' )->text(),
                                array(),
                                $q
                        );
                } else {
                        $s[] = Linker::linkKnown(
                                $li,
-                               wfMsg( 'login' ),
+                               wfMessage( 'login' )->text(),
                                array(),
                                $q
                        );
@@ -257,8 +253,8 @@ class CologneBlueTemplate extends LegacyTemplate {
                        $s .= '<strong>' . $this->editThisPage() . '</strong>';
 
                        $s .= $sep . Linker::linkKnown(
-                               Title::newFromText( wfMsgForContent( 'edithelppage' ) ),
-                               wfMsg( 'edithelp' )
+                               Title::newFromText( wfMessage( 'edithelppage' )->inContentLanguage()->text() ),
+                               wfMessage( 'edithelp' )->text()
                        );
 
                        if( $this->data['loggedin'] ) {
@@ -311,7 +307,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                if ( $this->data['loggedin'] ) {
                        $tl = Linker::link(
                                $user->getTalkPage(),
-                               wfMsg( 'mytalk' ),
+                               wfMessage( 'mytalk' )->text(),
                                array(),
                                array(),
                                array( 'known', 'noclasses' )
@@ -320,20 +316,14 @@ class CologneBlueTemplate extends LegacyTemplate {
                                $tl .= ' *';
                        }
 
-                       $s .= Linker::link(
+                       $s .= Linker::linkKnown(
                                        $user->getUserPage(),
-                                       wfMsg( 'mypage' ),
-                                       array(),
-                                       array(),
-                                       array( 'known', 'noclasses' )
+                                       wfMessage( 'mypage' )->text()
                                ) . $sep . $tl . $sep . Linker::specialLink( 'Watchlist' )
                                        . $sep .
-                               Linker::link(
+                               Linker::linkKnown(
                                        SpecialPage::getSafeTitleFor( 'Contributions', $user->getName() ),
-                                       wfMsg( 'mycontris' ),
-                                       array(),
-                                       array(),
-                                       array( 'known', 'noclasses' )
+                                       wfMessage( 'mycontris' )->text()
                                ) . $sep . Linker::specialLink( 'Preferences' )
                                . $sep . Linker::specialLink( 'Userlogout' );
                } else {
@@ -352,15 +342,12 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                if( $wgSiteSupportPage ) {
                        $s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">'
-                                       . wfMsg( 'sitesupport' ) . '</a>';
+                                       . wfMessage( 'sitesupport' )->text() . '</a>';
                }
 
-               $s .= $sep . Linker::link(
+               $s .= $sep . Linker::linkKnown(
                        SpecialPage::getTitleFor( 'Specialpages' ),
-                       wfMsg( 'moredotdotdot' ),
-                       array(),
-                       array(),
-                       array( 'known', 'noclasses' )
+                       wfMessage( 'moredotdotdot' )->text()
                );
 
                $s .= $sep . "\n</div>\n";
@@ -372,7 +359,7 @@ class CologneBlueTemplate extends LegacyTemplate {
         * @return string
         */
        function menuHead( $key ) {
-               $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
+               $s = "\n<h6>" . wfMessage( $key )->text() . "</h6>";
                return $s;
        }
 
@@ -392,12 +379,12 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
                        . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" /><br />"
-                       . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />";
+                       . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . wfMessage( 'searcharticle' )->escaped() . "\" />";
 
                if( $wgUseTwoButtonsSearchForm ) {
-                       $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n";
+                       $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . wfMessage( 'search' )->escaped() . "\" />\n";
                } else {
-                       $s .= '<div><a href="' . $action . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a></div>\n";
+                       $s .= '<div><a href="' . $action . '" rel="search">' . wfMessage( 'powersearch-legend' )->text() . "</a></div>\n";
                }
 
                $s .= '</form>';
index 98437e2..c3f73e5 100644 (file)
@@ -99,8 +99,8 @@ class NostalgiaTemplate extends LegacyTemplate {
                } else {
                        /* show user page and user talk links */
                        $user = $this->getSkin()->getUser();
-                       $s .= $sep . Linker::link( $user->getUserPage(), wfMsgHtml( 'mypage' ) );
-                       $s .= $sep . Linker::link( $user->getTalkPage(), wfMsgHtml( 'mytalk' ) );
+                       $s .= $sep . Linker::link( $user->getUserPage(), wfMessage( 'mypage' )->escaped() );
+                       $s .= $sep . Linker::link( $user->getTalkPage(), wfMessage( 'mytalk' )->escaped() );
                        if ( $user->getNewtalk() ) {
                                $s .= ' *';
                        }
@@ -109,7 +109,7 @@ class NostalgiaTemplate extends LegacyTemplate {
                        /* show my contributions link */
                        $s .= $sep . Linker::link(
                                SpecialPage::getSafeTitleFor( 'Contributions', $this->data['username'] ),
-                               wfMsgHtml( 'mycontris' ) );
+                               wfMessage( 'mycontris' )->escaped() );
                        /* show my preferences link */
                        $s .= $sep . Linker::specialLink( 'Preferences' );
                        /* show upload file link */
index 1114e7d..502e2b4 100644 (file)
@@ -133,7 +133,7 @@ class StandardTemplate extends LegacyTemplate {
                                        $s.= Linker::specialLink( 'Watchlist' ) ;
                                        $s .= $sep . Linker::linkKnown(
                                                SpecialPage::getTitleFor( 'Contributions' ),
-                                               wfMsg( 'mycontris' ),
+                                               wfMessage( 'mycontris' )->text(),
                                                array(),
                                                array( 'target' => $this->data['username'] )
                                        );
@@ -158,34 +158,34 @@ class StandardTemplate extends LegacyTemplate {
                                                case NS_TEMPLATE_TALK:
                                                case NS_HELP_TALK:
                                                case NS_CATEGORY_TALK:
-                                                       $text = wfMsg('viewtalkpage');
+                                                       $text = wfMessage('viewtalkpage');
                                                        break;
                                                case NS_MAIN:
-                                                       $text = wfMsg( 'articlepage' );
+                                                       $text = wfMessage( 'articlepage' );
                                                        break;
                                                case NS_USER:
-                                                       $text = wfMsg( 'userpage' );
+                                                       $text = wfMessage( 'userpage' );
                                                        break;
                                                case NS_PROJECT:
-                                                       $text = wfMsg( 'projectpage' );
+                                                       $text = wfMessage( 'projectpage' );
                                                        break;
                                                case NS_FILE:
-                                                       $text = wfMsg( 'imagepage' );
+                                                       $text = wfMessage( 'imagepage' );
                                                        break;
                                                case NS_MEDIAWIKI:
-                                                       $text = wfMsg( 'mediawikipage' );
+                                                       $text = wfMessage( 'mediawikipage' );
                                                        break;
                                                case NS_TEMPLATE:
-                                                       $text = wfMsg( 'templatepage' );
+                                                       $text = wfMessage( 'templatepage' );
                                                        break;
                                                case NS_HELP:
-                                                       $text = wfMsg( 'viewhelppage' );
+                                                       $text = wfMessage( 'viewhelppage' );
                                                        break;
                                                case NS_CATEGORY:
-                                                       $text = wfMsg( 'categorypage' );
+                                                       $text = wfMessage( 'categorypage' );
                                                        break;
                                                default:
-                                                       $text = wfMsg( 'articlepage' );
+                                                       $text = wfMessage( 'articlepage' );
                                        }
 
                                        $link = $title->getText();
@@ -194,11 +194,11 @@ class StandardTemplate extends LegacyTemplate {
                                                $link = $nstext . ':' . $link;
                                        }
 
-                                       $s .= Linker::link( Title::newFromText( $link ), $text );
+                                       $s .= Linker::link( Title::newFromText( $link ), $text->escaped() );
                                } elseif( $title->getNamespace() != NS_SPECIAL ) {
                                        # we just throw in a "New page" text to tell the user that he's in edit mode,
                                        # and to avoid messing with the separator that is prepended to the next item
-                                       $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
+                                       $s .= '<strong>' . wfMessage( 'newpage' )->escaped() . '</strong>';
                                }
                        }
 
@@ -206,7 +206,7 @@ class StandardTemplate extends LegacyTemplate {
                        if( ( $title->isTalkPage() || $this->getSkin()->getOutput()->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
                                $s .= '<br />' . Linker::link(
                                        $title,
-                                       wfMsg( 'postcomment' ),
+                                       wfMessage( 'postcomment' )->escaped(),
                                        array(),
                                        array(
                                                'action' => 'edit',
@@ -268,12 +268,11 @@ class StandardTemplate extends LegacyTemplate {
                global $wgSiteSupportPage;
                if( $wgSiteSupportPage ) {
                        $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
-                       '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
+                       '" class="internal">' . wfMessage( 'sitesupport' )->escaped() . '</a>';
                }
 
                $s .= "\n<br /></div>\n";
                wfProfileOut( __METHOD__ );
                return $s;
        }
-
 }