PHP warning from BaseTemplate::getFooterLinks() when $validFooterLinks is empty on PHP < 7.4
Closed, ResolvedPublic

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

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

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 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