Don't trigger filter hits for nonexisting filter 0

AbuseFilter::getConsequencesForFilters uses filter ids as
array keys, that causes problems if both local and global
filters were hit, because array_merge reindexes arrays.

Example:
https://www.mediawiki.org/wiki/Special:AbuseLog/18687

Change-Id: I81cb110322461e30113199cfa313cd8e8e8b2262
This commit is contained in:
Marius Hoch 2013-07-09 13:57:22 +02:00
parent 243df103b3
commit 4cb9a96ac9

View file

@ -641,10 +641,7 @@ class AbuseFilter {
if ( count( $globalFilters ) ) {
$fdb = wfGetDB( DB_SLAVE, array(), $wgAbuseFilterCentralDB );
$consequences = array_merge(
$consequences,
self::loadConsequencesFromDB( $fdb, $globalFilters, 'global-' )
);
$consequences = $consequences + self::loadConsequencesFromDB( $fdb, $globalFilters, 'global-' );
}
return $consequences;