Skip to content

[2.1.6]: Warnings produced by Sources/Load.php on line line 3410 #8985

@gregorklaric

Description

@gregorklaric

Basic Information

The language of my forum is slovenian and I get this warning thw whole time in the error_log

[16-Oct-2025 10:26:25 Europe/Berlin] PHP Warning: array_keys() expects parameter 1 to be array, null given in /public_html/gobe/forum/Sources/Load.php on line 3401
[16-Oct-2025 10:26:25 Europe/Berlin] PHP Warning: implode(): Invalid arguments passed in /public_html/gobe/forum/Sources/Load.php on line 3401

This is the code:


		if (substr_count(implode(' ', array_keys($context['languages'])), 'english') > 1 && $context['languages']['english']['name'] === 'English')
			$context['languages']['english']['name'] = 'English (US)';

I got rid of the warning by it by enclosing it into this:

if (!empty($context['languages']) && is_array($context['languages'])) {


}

Steps to reproduce

Expected result

No response

Actual result

No response

Version/Git revision

2.1.6

Database Engine

All

Database Version

No response

PHP Version

7.4

Logs

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions