Fixes border case when timezone is empty but not null

main
Yasen Pramatarov 2025-04-07 12:32:54 +03:00
parent aa530c20d2
commit b4fabb6d59
2 changed files with 3 additions and 4 deletions

View File

@ -47,7 +47,7 @@
<label class="form-label"><small>timezone:</small></label> <label class="form-label"><small>timezone:</small></label>
</div> </div>
<div class="col-md-8 text-start bg-light"> <div class="col-md-8 text-start bg-light">
<?php if (isset($userDetails[0]['timezone'])) { ?> <?php if (!empty($userDetails[0]['timezone'])) { ?>
<?= htmlspecialchars($userDetails[0]['timezone']) ?>&nbsp;&nbsp;<span style="font-size: 0.66em;">(<?= htmlspecialchars(getUTCOffset($userDetails[0]['timezone'])) ?>)</span> <?= htmlspecialchars($userDetails[0]['timezone']) ?>&nbsp;&nbsp;<span style="font-size: 0.66em;">(<?= htmlspecialchars(getUTCOffset($userDetails[0]['timezone'])) ?>)</span>
<?php } ?> <?php } ?>
</div> </div>

View File

@ -11,7 +11,7 @@
* Version: 0.3 * Version: 0.3
*/ */
// we start output buffering and. // we start output buffering and
// flush it later only when there is no redirect // flush it later only when there is no redirect
ob_start(); ob_start();
@ -195,8 +195,7 @@ if ($page == 'logout') {
$user_id = $userObject->getUserId($currentUser)[0]['id']; $user_id = $userObject->getUserId($currentUser)[0]['id'];
$userDetails = $userObject->getUserDetails($user_id); $userDetails = $userObject->getUserDetails($user_id);
$userRights = $userObject->getUserRights($user_id); $userRights = $userObject->getUserRights($user_id);
$userTimezone = isset($userDetails[0]['timezone']) ? $userDetails[0]['timezone'] : 'UTC'; // Default to UTC if no timezone is set $userTimezone = (!empty($userDetails[0]['timezone'])) ? $userDetails[0]['timezone'] : 'UTC'; // Default to UTC if no timezone is set (or is missing)
// check if the Jilo Server is running // check if the Jilo Server is running
require '../app/classes/server.php'; require '../app/classes/server.php';