Fixed: "strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated"

This commit is contained in:
Kamil Wylegala 2022-01-04 16:55:02 +01:00
parent d83997f849
commit ef0e0a7175

View file

@ -361,7 +361,8 @@ class Mysql extends DboSource {
$fields[$column->Field]['unsigned'] = $this->_unsigned($column->Type);
}
if (in_array($fields[$column->Field]['type'], array('timestamp', 'datetime')) &&
in_array(strtoupper($column->Default), array('CURRENT_TIMESTAMP', 'CURRENT_TIMESTAMP()'))
//Falling back to default empty string due to PHP8.1 deprecation notice.
in_array(strtoupper($column->Default ?? ""), array('CURRENT_TIMESTAMP', 'CURRENT_TIMESTAMP()'))
) {
$fields[$column->Field]['default'] = null;
}