SMF icon indicating copy to clipboard operation
SMF copied to clipboard

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

Open gregorklaric opened this issue 3 months ago • 0 comments

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

gregorklaric avatar Oct 17 '25 07:10 gregorklaric