MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc show notice when null is passed as an argument
This commit is contained in:
committed by
Andrew Nicols
parent
d83368a475
commit
2dd7290ccb
@@ -319,7 +319,7 @@ class core_date {
|
||||
if (!defined('PHPUNIT_TEST')) {
|
||||
throw new coding_exception('core_date::phpunit_override_default_php_timezone() must be used only from unit tests');
|
||||
}
|
||||
$result = timezone_open($tz); // This triggers error if $tz invalid.
|
||||
$result = timezone_open($tz ?? ''); // This triggers error if $tz invalid.
|
||||
if ($result !== false) {
|
||||
self::$defaultphptimezone = $tz;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user