mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
Unify global filters decoding across AbuseFilter
Change-Id: I3c97c24b5d0e4818b36e233a8bb3b205cbb2c7d0
This commit is contained in:
parent
1975e2ab13
commit
de1c2af0e1
|
@ -759,7 +759,7 @@ class AbuseFilter {
|
|||
self::getFilter( $filter )->af_public_comments
|
||||
);
|
||||
|
||||
$global_filter = ( preg_match( '/^global-/', $filter ) == 1 );
|
||||
$global_filter = self::decodeGlobalName( $filter ) !== false;
|
||||
|
||||
// If the filter is throttled and throttling is available via object
|
||||
// caching, check to see if the user has hit the throttle.
|
||||
|
@ -995,14 +995,14 @@ class AbuseFilter {
|
|||
global $wgAbuseFilterCentralDB;
|
||||
|
||||
if ( !isset( self::$filterCache[$id] ) ) {
|
||||
$m = [];
|
||||
if ( preg_match( '/^global-(\d+)$/', $id, $m ) ) {
|
||||
$globalIndex = self::decodeGlobalName( $id );
|
||||
if ( $globalIndex ) {
|
||||
// Global wiki filter
|
||||
if ( !$wgAbuseFilterCentralDB ) {
|
||||
return null; // not enabled
|
||||
}
|
||||
|
||||
$id = $m[1];
|
||||
$id = $globalIndex;
|
||||
$lb = wfGetLB( $wgAbuseFilterCentralDB );
|
||||
$dbr = $lb->getConnectionRef( DB_SLAVE, array(), $wgAbuseFilterCentralDB );
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue