diff --git a/includes/AbuseFilterChangesList.php b/includes/AbuseFilterChangesList.php index e6e7e0a91..5a611deed 100644 --- a/includes/AbuseFilterChangesList.php +++ b/includes/AbuseFilterChangesList.php @@ -1,13 +1,27 @@ testFilter = $testFilter; + } + /** * @param string &$s * @param RecentChange &$rc - * @param array &$classes + * @param string[] &$classes */ public function insertExtra( &$s, &$rc, &$classes ) { - $examineParams = empty( $rc->examineParams ) ? [] : $rc->examineParams; + $examineParams = []; + if ( $this->testFilter ) { + $examineParams['testfilter'] = $this->testFilter; + } $title = SpecialPage::getTitleFor( 'AbuseFilter', 'examine/' . $rc->mAttribs['rc_id'] ); $examineLink = $this->linkRenderer->makeLink( diff --git a/includes/Views/AbuseFilterViewExamine.php b/includes/Views/AbuseFilterViewExamine.php index e065ed1ad..28df36272 100644 --- a/includes/Views/AbuseFilterViewExamine.php +++ b/includes/Views/AbuseFilterViewExamine.php @@ -59,7 +59,7 @@ class AbuseFilterViewExamine extends AbuseFilterView { } function showResults() { - $changesList = new AbuseFilterChangesList( $this->getSkin() ); + $changesList = new AbuseFilterChangesList( $this->getSkin(), $this->mTestFilter ); $output = $changesList->beginRecentChangesList(); $this->mCounter = 1; diff --git a/includes/Views/AbuseFilterViewTestBatch.php b/includes/Views/AbuseFilterViewTestBatch.php index 4f4a66e43..00f8dca74 100644 --- a/includes/Views/AbuseFilterViewTestBatch.php +++ b/includes/Views/AbuseFilterViewTestBatch.php @@ -116,7 +116,7 @@ class AbuseFilterViewTestBatch extends AbuseFilterView { $conds[] = $this->buildTestConditions( $dbr ); // Get our ChangesList - $changesList = new AbuseFilterChangesList( $this->getSkin() ); + $changesList = new AbuseFilterChangesList( $this->getSkin(), $this->mFilter ); $output = $changesList->beginRecentChangesList(); $rcQuery = RecentChange::getQueryInfo(); @@ -143,7 +143,6 @@ class AbuseFilterViewTestBatch extends AbuseFilterView { if ( $result || $this->mShowNegative ) { // Stash result in RC item $rc = RecentChange::newFromRow( $row ); - $rc->examineParams['testfilter'] = $this->mFilter; $rc->filterResult = $result; $rc->counter = $counter++; $output .= $changesList->recentChangesLine( $rc, false ); diff --git a/includes/Views/AbuseFilterViewTools.php b/includes/Views/AbuseFilterViewTools.php index c86256173..cff4b22f6 100644 --- a/includes/Views/AbuseFilterViewTools.php +++ b/includes/Views/AbuseFilterViewTools.php @@ -4,6 +4,7 @@ class AbuseFilterViewTools extends AbuseFilterView { function show() { $out = $this->getOutput(); $user = $this->getUser(); + $request = $this->getRequest(); if ( !$user->isAllowed( 'abusefilter-modify' ) ) { $out->addWikiMsg( 'abusefilter-mustbeeditor' ); @@ -15,7 +16,7 @@ class AbuseFilterViewTools extends AbuseFilterView { // Expression evaluator $eval = ''; - $eval .= AbuseFilter::buildEditBox( '', 'wpTestExpr' ); + $eval .= AbuseFilter::buildEditBox( $request->getText( 'wpTestExpr' ), 'wpTestExpr' ); $eval .= Xml::tags( 'p', null, Xml::element( 'input',