Merge pull request #12695 from MrPetovan/bug/fatal-errors
Address a few fatal errors
This commit is contained in:
commit
15938c5b87
|
@ -87,6 +87,10 @@ class DbaDefinition
|
||||||
$data[$field] = mb_substr($data[$field], 0, $result[1]);
|
$data[$field] = mb_substr($data[$field], 0, $result[1]);
|
||||||
} elseif (is_string($data[$field]) && preg_match("/binary\((\d*)\)/", $definition[$table]['fields'][$field]['type'], $result)) {
|
} elseif (is_string($data[$field]) && preg_match("/binary\((\d*)\)/", $definition[$table]['fields'][$field]['type'], $result)) {
|
||||||
$data[$field] = substr($data[$field], 0, $result[1]);
|
$data[$field] = substr($data[$field], 0, $result[1]);
|
||||||
|
} elseif (is_numeric($data[$field]) && $definition[$table]['fields'][$field]['type'] === 'int') {
|
||||||
|
$data[$field] = min(max((int)$data[$field], -2147483648), 2147483647);
|
||||||
|
} elseif (is_numeric($data[$field]) && $definition[$table]['fields'][$field]['type'] === 'int unsigned') {
|
||||||
|
$data[$field] = min(max((int)$data[$field], 0), 4294967295);
|
||||||
}
|
}
|
||||||
$fields[$field] = $data[$field];
|
$fields[$field] = $data[$field];
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Maintenance extends BaseModule
|
||||||
{
|
{
|
||||||
protected function content(array $request = []): string
|
protected function content(array $request = []): string
|
||||||
{
|
{
|
||||||
$reason = DI::config()->get('system', 'maintenance_reason');
|
$reason = DI::config()->get('system', 'maintenance_reason') ?? '';
|
||||||
|
|
||||||
if ((substr(Strings::normaliseLink($reason), 0, 7) === 'http://') ||
|
if ((substr(Strings::normaliseLink($reason), 0, 7) === 'http://') ||
|
||||||
(substr(Strings::normaliseLink($reason), 0, 8) === 'https://')) {
|
(substr(Strings::normaliseLink($reason), 0, 8) === 'https://')) {
|
||||||
|
|
Loading…
Reference in a new issue