diff --git a/includes/AbuseFilter.class.php b/includes/AbuseFilter.class.php index b227642ff..fd12487a6 100644 --- a/includes/AbuseFilter.class.php +++ b/includes/AbuseFilter.class.php @@ -2187,10 +2187,7 @@ class AbuseFilter { $vars->setVar( 'ACTION', 'delete' ); if ( class_exists( CommentStore::class ) ) { - $vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' ) - // $row comes from RecentChange::selectFields() - ->getCommentLegacy( wfGetDB( DB_REPLICA ), $row )->text - ); + $vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )->getComment( $row )->text ); } else { $vars->setVar( 'SUMMARY', $row->rc_comment ); } @@ -2220,10 +2217,7 @@ class AbuseFilter { $vars->setVar( 'ACTION', 'edit' ); if ( class_exists( CommentStore::class ) ) { - $vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' ) - // $row comes from RecentChange::selectFields() - ->getCommentLegacy( wfGetDB( DB_REPLICA ), $row )->text - ); + $vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )->getComment( $row )->text ); } else { $vars->setVar( 'SUMMARY', $row->rc_comment ); } @@ -2267,10 +2261,7 @@ class AbuseFilter { ); if ( class_exists( CommentStore::class ) ) { - $vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' ) - // $row comes from RecentChange::selectFields() - ->getCommentLegacy( wfGetDB( DB_REPLICA ), $row )->text - ); + $vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )->getComment( $row )->text ); } else { $vars->setVar( 'SUMMARY', $row->rc_comment ); } diff --git a/includes/Views/AbuseFilterViewExamine.php b/includes/Views/AbuseFilterViewExamine.php index 22be4135d..8787ce28e 100644 --- a/includes/Views/AbuseFilterViewExamine.php +++ b/includes/Views/AbuseFilterViewExamine.php @@ -77,11 +77,14 @@ class AbuseFilterViewExamine extends AbuseFilterView { function showExaminerForRC( $rcid ) { // Get data $dbr = wfGetDB( DB_REPLICA ); + $rcQuery = RecentChange::getQueryInfo(); $row = $dbr->selectRow( - 'recentchanges', - RecentChange::selectFields(), + $rcQuery['tables'], + $rcQuery['fields'], [ 'rc_id' => $rcid ], - __METHOD__ + __METHOD__, + [], + $rcQuery['joins'] ); $out = $this->getOutput(); if ( !$row ) { @@ -247,11 +250,13 @@ class AbuseFilterExaminePager extends ReverseChronologicalPager { $conds[] = $this->mPage->buildTestConditions( $dbr ); + $rcQuery = RecentChange::getQueryInfo(); $info = [ - 'tables' => 'recentchanges', - 'fields' => RecentChange::selectFields(), + 'tables' => $rcQuery['tables'], + 'fields' => $rcQuery['fields'], 'conds' => array_filter( $conds ), 'options' => [ 'ORDER BY' => 'rc_timestamp DESC' ], + 'join_conds' => $rcQuery['joins'], ]; return $info; diff --git a/includes/Views/AbuseFilterViewTestBatch.php b/includes/Views/AbuseFilterViewTestBatch.php index e039c6192..4f4a66e43 100644 --- a/includes/Views/AbuseFilterViewTestBatch.php +++ b/includes/Views/AbuseFilterViewTestBatch.php @@ -119,12 +119,14 @@ class AbuseFilterViewTestBatch extends AbuseFilterView { $changesList = new AbuseFilterChangesList( $this->getSkin() ); $output = $changesList->beginRecentChangesList(); + $rcQuery = RecentChange::getQueryInfo(); $res = $dbr->select( - 'recentchanges', - RecentChange::selectFields(), + $rcQuery['tables'], + $rcQuery['fields'], array_filter( $conds ), __METHOD__, - [ 'LIMIT' => self::$mChangeLimit, 'ORDER BY' => 'rc_timestamp desc' ] + [ 'LIMIT' => self::$mChangeLimit, 'ORDER BY' => 'rc_timestamp desc' ], + $rcQuery['joins'] ); $counter = 1; diff --git a/includes/api/ApiAbuseFilterCheckMatch.php b/includes/api/ApiAbuseFilterCheckMatch.php index 46870e43b..58f657ace 100644 --- a/includes/api/ApiAbuseFilterCheckMatch.php +++ b/includes/api/ApiAbuseFilterCheckMatch.php @@ -19,11 +19,14 @@ class ApiAbuseFilterCheckMatch extends ApiBase { } } elseif ( $params['rcid'] ) { $dbr = wfGetDB( DB_REPLICA ); + $rcQuery = RecentChange::getQueryInfo(); $row = $dbr->selectRow( - 'recentchanges', - RecentChange::selectFields(), + $rcQuery['tables'], + $rcQuery['fields'], [ 'rc_id' => $params['rcid'] ], - __METHOD__ + __METHOD__, + [], + $rcQuery['joins'] ); if ( !$row ) {