mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Fix ccnorm() function -- strtr fails on empty key
ReplacementArray->replace() calls strtr() which fails if an empty key is provided. Change-Id: I635f057dab53edcfe1736f74829b6dbe1e7739d3
This commit is contained in:
parent
dce990fda2
commit
3b7cae1965
|
@ -1942,12 +1942,18 @@ class AbuseFilterParser {
|
|||
$equivset = null;
|
||||
// Contains a map of characters in $equivset.
|
||||
require "$IP/extensions/AntiSpoof/equivset.php";
|
||||
|
||||
// strtr in ReplacementArray->replace() doesn't like this.
|
||||
if ( isset( $equivset[''] ) ) {
|
||||
unset( $equivset[''] );
|
||||
}
|
||||
|
||||
$replacementArray = new ReplacementArray( $equivset );
|
||||
} else {
|
||||
// AntiSpoof isn't available, so just create a dummy
|
||||
wfDebugLog(
|
||||
'AbuseFilter',
|
||||
"Can't compute normalized string (ccnorm) as the AntiSpoof Extension isn't isntalled."
|
||||
"Can't compute normalized string (ccnorm) as the AntiSpoof Extension isn't installed."
|
||||
);
|
||||
$replacementArray = new ReplacementArray( array() );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue