Package: mediawiki
Version: 1:1.31.10-1~deb10u1

Hi,

In /usr/share/mediawiki/includes/skins/BaseTemplate.php after line 601, the $validFooterLinks is "flattened" without checking that it is non-empty.

This results in an unsightly warning in the web server log:

[Sun Oct 11 09:19:03.631271 2020] [proxy_fcgi:error] [pid 27294:tid 139621082044160] [client 114.119.136.128:13642] AH01071: Got error 'PHP message: PHP Warning: array_merge() expects at least 1 parameter, 0 given in /usr/share/mediawiki/includes/skins/BaseTemplate.php on line 603PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/mediawiki/skins/MonoBook/includes/MonoBookTemplate.php on line 527'

Bracketing the infringing code with count() as follows fixes the issue:

        if(count($validFooterLinks) > 0) {
                $validFooterLinks = call_user_func_array(
                        'array_merge',
                        array_values( $validFooterLinks )
                );
        }

(i.e. don't flatten the array if it is empty)

Thanks,

Alain

Reply via email to