mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-12 00:38:23 +00:00
Cache global filter names
AbuseLog fetches the names in an additional query for each line but the result is always same. Change-Id: Ie12f909727ae82ab60781ccedfdf1b241c105388
This commit is contained in:
parent
0f47be6d93
commit
a1aa09d31c
|
@ -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];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue