1
0
Fork 0

Merge pull request #12695 from MrPetovan/bug/fatal-errors

Address a few fatal errors
This commit is contained in:
Philipp 2023-01-19 08:09:03 +01:00 committed by GitHub
commit 15938c5b87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -87,6 +87,10 @@ class DbaDefinition
$data[$field] = mb_substr($data[$field], 0, $result[1]);
} elseif (is_string($data[$field]) && preg_match("/binary\((\d*)\)/", $definition[$table]['fields'][$field]['type'], $result)) {
$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];
}

View file

@ -36,7 +36,7 @@ class Maintenance extends BaseModule
{
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://') ||
(substr(Strings::normaliseLink($reason), 0, 8) === 'https://')) {