jenkins-bot has submitted this change and it was merged. Change subject: Replace deprecated wfMsg* functions ......................................................................
Replace deprecated wfMsg* functions Bug: T70750 Change-Id: I92846966b1307a3745027bc17fd43fc0447ba080 --- M SpecialPremoderation.php M SpecialPremoderationWhiteList.php 2 files changed, 36 insertions(+), 36 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/SpecialPremoderation.php b/SpecialPremoderation.php index 609c1ea..4471be6 100644 --- a/SpecialPremoderation.php +++ b/SpecialPremoderation.php @@ -50,7 +50,7 @@ break; default: - $wgOut->setPageTitle( wfMsg( 'premoderation-manager-invalidaction' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-manager-invalidaction' ) ); $wgOut->addWikiMsg( 'premoderation-invalidaction' ); } } @@ -58,7 +58,7 @@ protected function showList() { global $wgOut, $wgArticlePath; - $wgOut->setPageTitle( wfMsg( 'premoderation-manager-mainpage' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-manager-mainpage' ) ); $wgOut->addWikiMsg( 'premoderation-list-intro' ); $dbr = wfGetDB( DB_SLAVE ); @@ -96,11 +96,11 @@ if( isset( $offset ) ) { $wgOut->addHtml( Linker::link( $this->getPageTitle( "list/offset/$offset" ), - wfMsgHtml( 'premoderation-next' ) ) ); + $this->msg( 'premoderation-next' )->escaped() ) ); } if( isset( $result['new'] ) ) { - $msg = wfMsg( 'premoderation-list-new-h2' ); + $msg = $this->msg( 'premoderation-list-new-h2' )->text(); $wgOut->addWikiText( '<h2>' . $msg . '</h2>' ); $output = $this->getListTableHeader( 'new' ); @@ -113,7 +113,7 @@ } if( isset( $result['declined'] ) ) { - $msg = wfMsg( 'premoderation-list-declined-h2' ); + $msg = $this->msg( 'premoderation-list-declined-h2' )->text(); $wgOut->addWikiText( '<h2>' . $msg . '</h2>' ); $output = $this->getListTableHeader( 'declined' ); @@ -129,11 +129,11 @@ protected function getListTableHeader( $type ) { return Xml::openElement( 'table', array( 'id' => 'prem-table-' . $type, 'class' => 'wikitable', 'style' => 'width: 90%' ) ) . - '<tr><th>' . wfMsg( 'premoderation-table-list-time' ) . '</th>' . - '<th>' . wfMsg( 'premoderation-table-list-user' ) . '</th>' . - '<th colspan="2">' . wfMsg( 'premoderation-table-list-title' ) . '</th>' . - '<th>' . wfMsg( 'premoderation-table-list-summary' ) . '</th>' . - '<th>' . wfMsg( 'premoderation-table-list-status' ) . '</th><tr>'; + '<tr><th>' . $this->msg( 'premoderation-table-list-time' )->escaped() . '</th>' . + '<th>' . $this->msg( 'premoderation-table-list-user' )->escaped() . '</th>' . + '<th colspan="2">' . $this->msg( 'premoderation-table-list-title' )->escaped() . '</th>' . + '<th>' . $this->msg( 'premoderation-table-list-summary' )->escaped() . '</th>' . + '<th>' . $this->msg( 'premoderation-table-list-status' )->escaped() . '</th><tr>'; } protected function formatListTableRow( $row ) { @@ -145,7 +145,7 @@ return '<tr><td>' . $wgLang->timeanddate( $row['pmq_timestamp'] ) . '</td>' . '<td>' . Linker::userLink( $row['pmq_user'], $row['pmq_user_text'] ) . '</td>' . '<td>' . Linker::link( Title::newFromText( $row['pmq_page_title'], $row['pmq_page_ns'] ) ) . - '</td><td>' . ( $row['pmq_minor'] == 0 ? '' : ' ' . wfMsg( 'minoreditletter' ) ) . '</td>' . + '</td><td>' . ( $row['pmq_minor'] == 0 ? '' : ' ' . $this->msg( 'minoreditletter' )->escaped() ) . '</td>' . '<td>' . $row['pmq_summary'] . '</td><td>' . Linker::link( $this->getPageTitle( "status/id/" . $row['pmq_id'] ), wfMessage( 'premoderation-status-' . $row['pmq_status'] . @@ -158,7 +158,7 @@ $params = $this->mParams; if( !isset( $params['id'] ) ) { - $wgOut->setPageTitle( wfMsg( 'premoderation-manager-invalidaction' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-manager-invalidaction' ) ); $wgOut->addWikiMsg( 'premoderation-invalidaction' ); return; } @@ -174,15 +174,15 @@ ); $row = $dbr->fetchRow( $res ); if( !$row ) { - $wgOut->setPageTitle( wfMsg( 'premoderation-manager-invalidaction' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-manager-invalidaction' ) ); $wgOut->addWikiMsg( 'premoderation-notexists-id' ); return; } - $wgOut->setPageTitle( wfMsg( 'premoderation-manager-status' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-manager-status' ) ); $wgOut->addWikiMsg( 'premoderation-status-intro' ); - $wgOut->addHTML( '<h2>' . wfMsg( 'premoderation-status-info' ) . '</h2>' . + $wgOut->addHTML( '<h2>' . $this->msg( 'premoderation-status-info' )->escaped() . '</h2>' . $this->getListTableHeader( 'status' ) . $this->formatListTableRow( $row ) . Xml::closeElement( 'table' ) ); @@ -197,7 +197,7 @@ isset( $rev ) ? $rev->getText() : '', $row['pmq_text'] ); - $wgOut->addHTML( '<h2>' . wfMsg( 'premoderation-diff-h2' ) . '</h2>' . + $wgOut->addHTML( '<h2>' . $this->msg( 'premoderation-diff-h2' )->escaped() . '</h2>' . "<table class='mw-abusefilter-diff-multiline'><col class='diff-marker' />" . "<col class='diff-content' /><col class='diff-marker' /><col class='diff-content' />" . "<tbody>" . $formattedDiff . "</tbody></table>" ); @@ -209,7 +209,7 @@ $externalConflicts = $this->checkExternalConflicts( $row['pmq_page_last_id'], $row['pmq_page_ns'], $row['pmq_page_title'] ); if( $externalConflicts ) { - $wgOut->addHTML( '<h2>' . wfMsg( 'premoderation-external-conflicts-h2' ) . '</h2>' ); + $wgOut->addHTML( '<h2>' . $this->msg( 'premoderation-external-conflicts-h2' )->escaped() . '</h2>' ); if( $wgPremoderationStrict ) { $wgOut->addWikiMsg( 'premoderation-error-externals' ); return; @@ -219,7 +219,7 @@ $this->checkInternalConflicts( $dbr, $id, $row['pmq_page_ns'], $row['pmq_page_title'] ); - $final = Xml::fieldset( wfMsg( 'premoderation-status-fieldset' ) ) . + $final = Xml::fieldset( $this->msg( 'premoderation-status-fieldset' )->text() ) . Xml::openElement( 'form', array( 'id' => 'prem-status-form', 'method' => 'post' ) ) . $this->getStatusForm( $row['pmq_status'] ) . '<input type="hidden" name="id" value="' . $id . '" />' . @@ -253,8 +253,8 @@ $test = $db->fetchRow( $res ); if( $test ) { - $output = '<h2>' . wfMsg( 'premoderation-internal-conflicts-h2' ) . '</h2>' . - wfMsg( 'premoderation-internal-conflicts-intro' ) . $this->getListTableHeader( 'int-conflicts' ) . + $output = '<h2>' . $this->msg( 'premoderation-internal-conflicts-h2' )->escaped() . '</h2>' . + $this->msg( 'premoderation-internal-conflicts-intro' )->escaped() . $this->getListTableHeader( 'int-conflicts' ) . $this->formatListTableRow( $test ); while( $row = $db->fetchRow( $res ) ) { @@ -274,14 +274,14 @@ // premoderation-status-approved, premoderation-status-declined, premoderation-status-new $options = ''; foreach( $statusList as $item ) { - $options .= Xml::option( wfMsg("premoderation-status-$item"), $item ); + $options .= Xml::option( $this->msg("premoderation-status-$item")->text(), $item ); } return "<table><tr><td><span style='white-space: nowrap'>" . Xml::tags( 'select', array( 'id' => 'prem-status-selector', 'name' => 'statusselector' ), $options ) . - '</span></td></tr><tr><td>' . wfMsg( 'summary' ) . ' ' . + '</span></td></tr><tr><td>' . $this->msg( 'summary' )->escaped() . ' ' . Xml::input( 'summary', 90, '', array( 'id' => 'prem-summary' ) ) . '</td></tr><tr>' . - '<td>' . Xml::submitButton( wfMsg( 'htmlform-submit' ), array( 'id' => 'prem-submit' ) ) . + '<td>' . Xml::submitButton( $this->msg( 'htmlform-submit' )->text(), array( 'id' => 'prem-submit' ) ) . '</td></tr></table>'; } @@ -295,7 +295,7 @@ $this->mSummary = isset( $data['summary'] ) ? $data['summary'] : ''; if( !in_array( $newstatus, $this->mAllowedStatus ) || !$id ) { - $wgOut->setPageTitle( wfMsg( 'premoderation-manager-invalidaction' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-manager-invalidaction' ) ); $wgOut->addWikiMsg( 'premoderation-bad-request' ); return; } @@ -305,14 +305,14 @@ $s = $this->changeStatus( $id, $newstatus ); if( $ok && $s ) { - $wgOut->setPageTitle( wfMsg( 'premoderation-success' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-success' ) ); $wgOut->addWikiMsg( 'premoderation-success-approved' ); } } else { $ok = $this->changeStatus( $id, $newstatus ); if( $ok && $this->addLogEntry( 'status', array( $id, $newstatus ) ) ) { - $wgOut->setPageTitle( wfMsg( 'premoderation-success' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-success' ) ); $wgOut->addWikiMsg( 'premoderation-success-changed-text' ); } } diff --git a/SpecialPremoderationWhiteList.php b/SpecialPremoderationWhiteList.php index bdea5b8..99552c9 100644 --- a/SpecialPremoderationWhiteList.php +++ b/SpecialPremoderationWhiteList.php @@ -29,7 +29,7 @@ throw new UserBlockedError( $this->getUser()->getBlock() ); } - $wgOut->setPageTitle( wfMsg( 'premoderationwhitelist' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderationwhitelist' ) ); $wgOut->addWikiMsg( 'premoderation-whitelist-intro' ); $params = array_values( explode( '/', $subpage ) ); @@ -40,22 +40,22 @@ } elseif( $action == 'list' && isset( $params ) ) { $this->mParams = Premoderation::formatParams( $params ); } else { - $wgOut->setPageTitle( wfMsg( 'premoderation-manager-invalidaction' ) ); + $wgOut->setPageTitle( $this->msg( 'premoderation-manager-invalidaction' ) ); $wgOut->addWikiMsg( 'premoderation-invalidaction' ); return; } if( $this->mPosted ) { $msg = $this->updateList(); - $wgOut->addHTML( '<p class="error">' . wfMsg( $msg ) . '</p>' ); + $wgOut->addHTML( '<p class="error">' . $this->msg( $msg )->escaped() . '</p>' ); } $wgOut->addHTML( $this->getAddForm() ); $whiteList = Premoderation::loadWhitelist(); if( is_array( $whiteList ) ) { - $output = '<table class="wikitable"><tr><th>' . wfMsg( 'premoderation-table-list-ip' ) . - '</th><th>' . wfMsg( 'premoderation-table-list-delete' ) . '</th></tr>'; + $output = '<table class="wikitable"><tr><th>' . $this->msg( 'premoderation-table-list-ip' )->escaped() . + '</th><th>' . $this->msg( 'premoderation-table-list-delete' )->escaped() . '</th></tr>'; foreach( $whiteList as $ip ) { $output .= '<tr><td>' . $ip . '</td>' . '<td>' . $this->getDeletionButton( $ip ) . '</td></tr>'; @@ -68,20 +68,20 @@ } protected function getAddForm() { - return Xml::fieldset( wfMsg( 'premoderation-wl-addip-fieldset' ) ) . + return Xml::fieldset( $this->msg( 'premoderation-wl-addip-fieldset' )->text() ) . Xml::openElement( 'form', array( 'id' => 'prem-wl-form', 'method' => 'post' ) ) . - '<table><tr><td>' . wfMsg( 'premoderation-private-ip' ) . '</td><td>' . + '<table><tr><td>' . $this->msg( 'premoderation-private-ip' )->escaped() . '</td><td>' . Xml::input( 'ip', 50, '', array( 'id' => 'prem-whitelist-addip' ) ) . '</td></tr>' . - '<tr><td>' . wfMsg( 'summary' ) . '</td><td>' . Xml::input( 'summary', 50, '', + '<tr><td>' . $this->msg( 'summary' )->escaped() . '</td><td>' . Xml::input( 'summary', 50, '', array( 'id' => 'prem-summary' ) ) . '</td></tr><tr>' . '<td>' . - Xml::submitButton( wfMsg( 'htmlform-submit' ), array( 'id' => 'prem-wl-submit' ) ) . + Xml::submitButton( $this->msg( 'htmlform-submit' )->text(), array( 'id' => 'prem-wl-submit' ) ) . '<input type="hidden" name="action" value="add" /></td></tr></table>' . Xml::closeElement( 'form' ) . Xml::closeElement( 'fieldset' ); } protected function getDeletionButton( $ip ) { return Xml::openElement( 'form', array( 'id' => 'prem-wl-delete' . $ip, 'method' => 'post' ) ) . - Xml::submitButton( wfMsg( 'premoderation-table-list-delete' ) ) . + Xml::submitButton( $this->msg( 'premoderation-table-list-delete' )->escaped() ) . '<input type="hidden" name="action" value="delete" />' . '<input type="hidden" name="ip" value="' . $ip . '" />' . Xml::closeElement( 'form' ); -- To view, visit https://gerrit.wikimedia.org/r/262065 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I92846966b1307a3745027bc17fd43fc0447ba080 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Premoderation Gerrit-Branch: master Gerrit-Owner: MtDu <justin.d...@gmail.com> Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> Gerrit-Reviewer: Reedy <re...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits