From 594f738c6d0cbfd4e5bf5240c3e535cb8eb74b56 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 18 Jan 2023 20:49:08 -0500 Subject: [PATCH 1/3] Create base `sub/direction.tpl` template from vier - Address https://github.com/friendica/friendica/issues/12486#issuecomment-1383249754 --- view/{theme/vier => }/templates/sub/direction.tpl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename view/{theme/vier => }/templates/sub/direction.tpl (100%) diff --git a/view/theme/vier/templates/sub/direction.tpl b/view/templates/sub/direction.tpl similarity index 100% rename from view/theme/vier/templates/sub/direction.tpl rename to view/templates/sub/direction.tpl From 3b99b98678077914bc8798f7cc535c0b007545fd Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 18 Jan 2023 20:58:49 -0500 Subject: [PATCH 2/3] Truncate integer values before inserting them - Address https://github.com/friendica/friendica/issues/12486#issuecomment-1383250353 --- src/Database/Definition/DbaDefinition.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Database/Definition/DbaDefinition.php b/src/Database/Definition/DbaDefinition.php index b65a7d30ed..1e597bd64b 100644 --- a/src/Database/Definition/DbaDefinition.php +++ b/src/Database/Definition/DbaDefinition.php @@ -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]; } From c05956137af4775f89865f8e207ace4b73c9a315 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 18 Jan 2023 21:01:07 -0500 Subject: [PATCH 3/3] Default maintenance reason to empty string in Module\Maintenance - Address https://github.com/friendica/friendica/issues/12486#issuecomment-1383250546 --- src/Module/Maintenance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Maintenance.php b/src/Module/Maintenance.php index 412723db31..67f65b8e39 100644 --- a/src/Module/Maintenance.php +++ b/src/Module/Maintenance.php @@ -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://')) {