Page MenuHomePhabricator

TitleBlacklist treats empty lines in MediaWiki:TitleBlacklist incorrectly
Open, Needs TriagePublic

Description

Under HHVM 3.11.1, the line 423 @list( $full, $regex, $null, $opts_str ) = $pockets; of (MW install path)/extensions/TitleBlacklist/TitleBlacklist.list.php prints the below exeption into debug log for any empty line in MediaWiki:TitleBlacklist:

[error-json] {"id":"67b1666b","type":"ErrorException","file":"(MW install path)/extensions/TitleBlacklist/TitleBlacklist.list.php","line":417,"message":"PHP Notice: Undefined index: 3","code":0,"url":"/w/index.php?title=Test6&action=submit","suppressed":true,"backtrace":[{"file":"(MW install path)/extensions/TitleBlacklist/TitleBlacklist.list.php","line":417,"function":"handleError","class":"MWExceptionHandler","type":"::","args":["integer","string","string","integer","array","array"]},{"file":"(MW install path)/extensions/TitleBlacklist/TitleBlacklist.list.php","line":129,"function":"newFromString","class":"TitleBlacklistEntry","type":"::","args":["string","string"]},{"file":"(MW install path)/extensions/TitleBlacklist/TitleBlacklist.list.php","line":52,"function":"parseBlacklist","class":"TitleBlacklist","type":"::","args":["string","string"]},{"file":"(MW install path)/extensions/TitleBlacklist/TitleBlacklist.list.php","line":227,"function":"load","class":"TitleBlacklist","type":"->","args":[]},{"file":"(MW install path)/extensions/TitleBlacklist/TitleBlacklist.list.php","line":180,"function":"getBlacklist","class":"TitleBlacklist","type":"->","args":[]},{"file":"(MW install path)/extensions/TitleBlacklist/TitleBlacklist.hooks.php","line":61,"function":"isBlacklisted","class":"TitleBlacklist","type":"->","args":["Title","string"]},{"file":"(MW install path)/includes/Hooks.php","line":201,"function":"displayBlacklistOverrideNotice","class":"TitleBlacklistHooks","type":"::","args":["Title","integer","array"]},{"file":"(MW install path)/includes/Title.php","line":4760,"function":"run","class":"Hooks","type":"::","args":["string","array"]},{"file":"(MW install path)/includes/EditPage.php","line":2656,"function":"getEditNotices","class":"Title","type":"->","args":["integer"]},{"file":"(MW install path)/includes/EditPage.php","line":2422,"function":"showHeader","class":"EditPage","type":"->","args":[]},{"file":"(MW install path)/includes/EditPage.php","line":582,"function":"showEditForm","class":"EditPage","type":"->","args":[]},{"file":"(MW install path)/includes/actions/EditAction.php","line":58,"function":"edit","class":"EditPage","type":"->","args":[]},{"file":"(MW install path)/includes/actions/SubmitAction.php","line":40,"function":"show","class":"EditAction","type":"->","args":[]},{"file":"(MW install path)/includes/MediaWiki.php","line":490,"function":"show","class":"SubmitAction","type":"->","args":[]},{"file":"(MW install path)/includes/MediaWiki.php","line":287,"function":"performAction","class":"MediaWiki","type":"->","args":["Article","Title"]},{"file":"(MW install path)/includes/MediaWiki.php","line":714,"function":"performRequest","class":"MediaWiki","type":"->","args":[]},{"file":"(MW install path)/includes/MediaWiki.php","line":508,"function":"main","class":"MediaWiki","type":"->","args":[]},{"file":"(MW install path)/index.php","line":41,"function":"run","class":"MediaWiki","type":"->","args":[]}]}

This can be cured by inserting if (!$line) return null; before that line.

Event Timeline

alex-mashin raised the priority of this task from to Needs Triage.
alex-mashin updated the task description. (Show Details)
alex-mashin added a project: TitleBlacklist.
alex-mashin added a subscriber: alex-mashin.

Change 268413 had a related patch set uploaded (by PlasmaPower):
Ignore blank lines (previously caused a warning)

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

Change 268413 merged by jenkins-bot:
[mediawiki/extensions/TitleBlacklist@master] Ignore blank lines (previously caused a warning)

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