]> git.mxchange.org Git - friendica.git/commitdiff
Set first_day_of_week config value default correctly
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Jan 2025 18:33:14 +0000 (13:33 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Jan 2025 22:45:23 +0000 (17:45 -0500)
↪ Config value could be empty string and cause a script error

src/Util/Temporal.php

index 098b60d5e803d32917f9c492c5768d2bf7c72413..e0f492000b8c371953e76bea14cd0fc6d57d8c36 100644 (file)
@@ -226,7 +226,7 @@ class Temporal
                bool $required = false): string
        {
                // First day of the week (0 = Sunday)
-               $firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'calendar', 'first_day_of_week', 0);
+               $firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'calendar', 'first_day_of_week') ?: 0;
 
                $lang = DI::l10n()->toISO6391(DI::l10n()->getCurrentLang());