Page MenuHomePhabricator

PHP warning from BaseTemplate::getFooterLinks() when $validFooterLinks is empty on PHP < 7.4
Open, Needs TriagePublic

Description

		if ( $option == 'flat' ) {
			// fold footerlinks into a single array using a bit of trickery
			$validFooterLinks = array_merge( ...array_values( $validFooterLinks ) );
		}

In 1.31 similar code that uses call_user_func_array has the same problem.

On PHP < 7.4, array_merge will emit a warning if passed no arguments (https://3v4l.org/I4Bpc).

This was reported downstream at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=971985.

Event Timeline

Legoktm created this task.Oct 11 2020, 10:00 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 11 2020, 10:00 PM

Change 633474 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Guard against passing zero arg to array_merge()

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

Ammarpad claimed this task.Oct 12 2020, 5:29 PM

Change 636705 had a related patch set uploaded (by Reedy; owner: Ammarpad):
[mediawiki/core@REL1_35] BaseTemplate: Guard against passing zero arg to array_merge()

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

Change 636786 had a related patch set uploaded (by Reedy; owner: Ammarpad):
[mediawiki/core@REL1_31] BaseTemplate: Guard against passing zero arg to array_merge()

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

Change 636786 merged by jenkins-bot:
[mediawiki/core@REL1_31] BaseTemplate: Guard against passing zero arg to array_merge()

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

Change 636705 merged by jenkins-bot:
[mediawiki/core@REL1_35] BaseTemplate: Guard against passing zero arg to array_merge()

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

Reedy moved this task from Backlog to Done on the MW-1.31-release board.Wed, Oct 28, 1:10 AM
Reedy moved this task from Blocker to Done on the MW-1.35-release board.

Change 633474 merged by jenkins-bot:
[mediawiki/core@master] BaseTemplate: Guard against passing zero arg to array_merge()

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