[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Avoid wfMessage() in AbuseFilter::buildVarDumpTable()
jenkins-bot has submitted this change and it was merged. Change subject: Avoid wfMessage() in AbuseFilter::buildVarDumpTable() .. Avoid wfMessage() in AbuseFilter::buildVarDumpTable() Change-Id: I3377623e6ba7f4c203de69d25f677162d6e61e65 --- M AbuseFilter.class.php M Views/AbuseFilterViewExamine.php M special/SpecialAbuseLog.php 3 files changed, 9 insertions(+), 8 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 60e2978..407bcf8 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -2261,10 +2261,11 @@ } /** -* @param $vars AbuseFilterVariableHolder +* @param AbuseFilterVariableHolder $vars +* @param IContextSource $context * @return string */ - public static function buildVarDumpTable( $vars ) { + public static function buildVarDumpTable( $vars, IContextSource $context ) { // Export all values if ( $vars instanceof AbuseFilterVariableHolder ) { $vars = $vars->exportAllVars(); @@ -2284,8 +2285,8 @@ "\n"; $header = - Xml::element( 'th', null, wfMessage( 'abusefilter-log-details-var' )->text() ) . - Xml::element( 'th', null, wfMessage( 'abusefilter-log-details-val' )->text() ); + Xml::element( 'th', null, $context->msg( 'abusefilter-log-details-var' )->text() ) . + Xml::element( 'th', null, $context->msg( 'abusefilter-log-details-val' )->text() ); $output .= Xml::tags( 'tr', null, $header ) . "\n"; if ( !count( $vars ) ) { @@ -2300,8 +2301,8 @@ if ( !empty( $variableMessageMappings[$key] ) ) { $mapping = $variableMessageMappings[$key]; - $keyDisplay = wfMessage( "abusefilter-edit-builder-vars-$mapping" )->parse() . - ' ' . Xml::element( 'code', null, wfMessage( 'parentheses', $key )->text() ); + $keyDisplay = $context->msg( "abusefilter-edit-builder-vars-$mapping" )->parse() . + ' ' . Xml::element( 'code', null, $context->msg( 'parentheses', $key )->text() ); } else { $keyDisplay = Xml::element( 'code', null, $key ); } diff --git a/Views/AbuseFilterViewExamine.php b/Views/AbuseFilterViewExamine.php index 6096823..e9b18cf 100644 --- a/Views/AbuseFilterViewExamine.php +++ b/Views/AbuseFilterViewExamine.php @@ -184,7 +184,7 @@ null, $this->msg( 'abusefilter-examine-vars', 'parseinline' )->parse() ); - $html .= AbuseFilter::buildVarDumpTable( $vars ); + $html .= AbuseFilter::buildVarDumpTable( $vars, $this->getContext() ); $output->addHTML( $html ); } diff --git a/special/SpecialAbuseLog.php b/special/SpecialAbuseLog.php index 8ce704d..afcc6ea 100644 --- a/special/SpecialAbuseLog.php +++ b/special/SpecialAbuseLog.php @@ -364,7 +364,7 @@ $output .= Xml::element( 'h3', null, $this->msg( 'abusefilter-log-details-vars' )->text() ); // Build a table. - $output .= AbuseFilter::buildVarDumpTable( $vars ); + $output .= AbuseFilter::buildVarDumpTable( $vars, $this->getContext() ); if ( self::canSeePrivate() ) { // Private stuff, like IPs. -- To view, visit https://gerrit.wikimedia.org/r/311214 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3377623e6ba7f4c203de69d25f677162d6e61e65 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Hoo man Gerrit-Reviewer: Jackmcbarn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Avoid wfMessage() in AbuseFilter::buildVarDumpTable()
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/311214 Change subject: Avoid wfMessage() in AbuseFilter::buildVarDumpTable() .. Avoid wfMessage() in AbuseFilter::buildVarDumpTable() Change-Id: I3377623e6ba7f4c203de69d25f677162d6e61e65 --- M AbuseFilter.class.php M Views/AbuseFilterViewExamine.php M special/SpecialAbuseLog.php 3 files changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/14/311214/1 diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 60e2978..ad6b840 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -2261,10 +2261,11 @@ } /** -* @param $vars AbuseFilterVariableHolder +* @param AbuseFilterVariableHolder $vars +* @param IContextSource $context * @return string */ - public static function buildVarDumpTable( $vars ) { + public static function buildVarDumpTable( $vars, IContextSource $context ) { // Export all values if ( $vars instanceof AbuseFilterVariableHolder ) { $vars = $vars->exportAllVars(); @@ -2284,8 +2285,8 @@ "\n"; $header = - Xml::element( 'th', null, wfMessage( 'abusefilter-log-details-var' )->text() ) . - Xml::element( 'th', null, wfMessage( 'abusefilter-log-details-val' )->text() ); + Xml::element( 'th', null, $context->msg( 'abusefilter-log-details-var' )->text() ) . + Xml::element( 'th', null, $context->msg( 'abusefilter-log-details-val' )->text() ); $output .= Xml::tags( 'tr', null, $header ) . "\n"; if ( !count( $vars ) ) { @@ -2300,7 +2301,7 @@ if ( !empty( $variableMessageMappings[$key] ) ) { $mapping = $variableMessageMappings[$key]; - $keyDisplay = wfMessage( "abusefilter-edit-builder-vars-$mapping" )->parse() . + $keyDisplay = $context->msg( "abusefilter-edit-builder-vars-$mapping" )->parse() . ' ' . Xml::element( 'code', null, wfMessage( 'parentheses', $key )->text() ); } else { $keyDisplay = Xml::element( 'code', null, $key ); diff --git a/Views/AbuseFilterViewExamine.php b/Views/AbuseFilterViewExamine.php index 6096823..e9b18cf 100644 --- a/Views/AbuseFilterViewExamine.php +++ b/Views/AbuseFilterViewExamine.php @@ -184,7 +184,7 @@ null, $this->msg( 'abusefilter-examine-vars', 'parseinline' )->parse() ); - $html .= AbuseFilter::buildVarDumpTable( $vars ); + $html .= AbuseFilter::buildVarDumpTable( $vars, $this->getContext() ); $output->addHTML( $html ); } diff --git a/special/SpecialAbuseLog.php b/special/SpecialAbuseLog.php index 8ce704d..afcc6ea 100644 --- a/special/SpecialAbuseLog.php +++ b/special/SpecialAbuseLog.php @@ -364,7 +364,7 @@ $output .= Xml::element( 'h3', null, $this->msg( 'abusefilter-log-details-vars' )->text() ); // Build a table. - $output .= AbuseFilter::buildVarDumpTable( $vars ); + $output .= AbuseFilter::buildVarDumpTable( $vars, $this->getContext() ); if ( self::canSeePrivate() ) { // Private stuff, like IPs. -- To view, visit https://gerrit.wikimedia.org/r/311214 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3377623e6ba7f4c203de69d25f677162d6e61e65 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits