Page MenuHomePhabricator

SpamBlacklist blacklist validation is broken
Closed, ResolvedPublic

Description

BaseBlacklist::getTypeFromTitle() is broken.

> var_dump(BaseBlacklist::getTypeFromTitle(Title::newFromText('MediaWiki:Spam-blacklist')));
bool(false)

Should have returned 'spam'.

The super convoluted code in that function generated a regex of /(spam|email)-(?:Blacklist|Whitelist)/ which has the wrong case to match Spam-blacklist. Adding the i modifier for case insensitivity fixes it.

Event Timeline

Change 363514 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/SpamBlacklist@master] Unbreak BaseBlacklist::getTypeFromTitle() and add tests

https://gerrit.wikimedia.org/r/363514

Change 363514 merged by jenkins-bot:
[mediawiki/extensions/SpamBlacklist@master] Unbreak BaseBlacklist::getTypeFromTitle() and add tests

https://gerrit.wikimedia.org/r/363514