diff --git a/includes/AbuseFilter.class.php b/includes/AbuseFilter.class.php index fd0d8bba8..7a74a8fb0 100644 --- a/includes/AbuseFilter.class.php +++ b/includes/AbuseFilter.class.php @@ -2408,14 +2408,21 @@ class AbuseFilter { return ''; } + static $cache = []; + if ( isset( $cache[$filterID] ) ) { + return $cache[$filterID]; + } + $fdb = wfGetDB( DB_SLAVE, [], $wgAbuseFilterCentralDB ); - return $fdb->selectField( + $cache[$filterID] = $fdb->selectField( 'abuse_filter', 'af_public_comments', [ 'af_id' => $filterID ], __METHOD__ ); + + return $cache[$filterID]; } /**