diff --git a/includes/Views/AbuseFilterViewDiff.php b/includes/Views/AbuseFilterViewDiff.php index 0fc865888..8128ad654 100644 --- a/includes/Views/AbuseFilterViewDiff.php +++ b/includes/Views/AbuseFilterViewDiff.php @@ -145,18 +145,31 @@ class AbuseFilterViewDiff extends AbuseFilterView { } $dbr = wfGetDB( DB_REPLICA ); + // All but afh_filter, afh_deleted and afh_changed_fields + $selectFields = [ + 'afh_id', + 'afh_user', + 'afh_user_text', + 'afh_timestamp', + 'afh_pattern', + 'afh_comments', + 'afh_flags', + 'afh_public_comments', + 'afh_actions', + 'afh_group', + ]; $row = null; if ( is_numeric( $spec ) ) { $row = $dbr->selectRow( 'abuse_filter_history', - '*', + $selectFields, [ 'afh_id' => $spec, 'afh_filter' => $this->mFilter ], __METHOD__ ); } elseif ( $spec == 'cur' ) { $row = $dbr->selectRow( 'abuse_filter_history', - '*', + $selectFields, [ 'afh_filter' => $this->mFilter ], __METHOD__, [ 'ORDER BY' => 'afh_timestamp desc' ] @@ -167,7 +180,7 @@ class AbuseFilterViewDiff extends AbuseFilterView { $row = $dbr->selectRow( 'abuse_filter_history', - '*', + $selectFields, [ 'afh_filter' => $this->mFilter, 'afh_id<' . $dbr->addQuotes( $other['meta']['history_id'] ), @@ -187,7 +200,7 @@ class AbuseFilterViewDiff extends AbuseFilterView { $row = $dbr->selectRow( 'abuse_filter_history', - '*', + $selectFields, [ 'afh_filter' => $this->mFilter, 'afh_id>' . $dbr->addQuotes( $other['meta']['history_id'] ), diff --git a/includes/Views/AbuseFilterViewEdit.php b/includes/Views/AbuseFilterViewEdit.php index fac959b8e..1d2182085 100644 --- a/includes/Views/AbuseFilterViewEdit.php +++ b/includes/Views/AbuseFilterViewEdit.php @@ -1049,8 +1049,9 @@ class AbuseFilterViewEdit extends AbuseFilterView { // Load the actions $actions = []; - $res = $dbr->select( 'abuse_filter_action', - '*', + $res = $dbr->select( + 'abuse_filter_action', + [ 'afa_consequence', 'afa_parameters' ], [ 'afa_filter' => $id ], __METHOD__ ); diff --git a/includes/Views/AbuseFilterViewRevert.php b/includes/Views/AbuseFilterViewRevert.php index 1b5261fd3..38a0d0731 100644 --- a/includes/Views/AbuseFilterViewRevert.php +++ b/includes/Views/AbuseFilterViewRevert.php @@ -164,8 +164,20 @@ class AbuseFilterViewRevert extends AbuseFilterView { $conds[] = 'afl_timestamp <= ' . $dbr->addQuotes( $dbr->timestamp( $periodEnd ) ); } - // Database query. - $res = $dbr->select( 'abuse_filter_log', '*', $conds, __METHOD__ ); + // All but afl_filter, afl_ip, afl_deleted, afl_patrolled_by, afl_rev_id and afl_log_id + $selectFields = [ + 'afl_id', + 'afl_user', + 'afl_user_text', + 'afl_action', + 'afl_actions', + 'afl_var_dump', + 'afl_timestamp', + 'afl_namespace', + 'afl_title', + 'afl_wiki', + ]; + $res = $dbr->select( 'abuse_filter_log', $selectFields, $conds, __METHOD__ ); $results = []; foreach ( $res as $row ) {