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

Legoktm created this task.Jul 6 2017, 12:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 6 2017, 12:56 AM

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

Jdforrester-WMF closed this task as Resolved.Jul 7 2017, 11:17 PM
Jdforrester-WMF removed a project: Patch-For-Review.

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

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