diff --git a/includes/classes/options.php b/includes/classes/options.php index f5579ade..3a20cafe 100644 --- a/includes/classes/options.php +++ b/includes/classes/options.php @@ -20,11 +20,19 @@ class Options public function getOption(string $key): string { - $option = $this->database->query( - 'SELECT * FROM `options` - WHERE `key` = "' . $key . '";' - )->fetch(); + $value = ''; - return $option['value'] ?? ''; + try { + $option = $this->database->query( + 'SELECT * FROM `options` + WHERE `key` = "' . $key . '";' + )->fetch(); + + $value = $option['value'] ?? ''; + } catch (\Throwable $th) { + //throw $th; + } + + return $value; } } diff --git a/includes/classes/page.php b/includes/classes/page.php index 015d8afa..65c98be7 100644 --- a/includes/classes/page.php +++ b/includes/classes/page.php @@ -27,6 +27,7 @@ class Page */ $disableRedirect = array( 'login', + 'register', 'install' ); if (!isset($_SESSION['user']) && isset($_GET['page']) && !in_array($_GET['page'], $disableRedirect)) { @@ -126,9 +127,9 @@ class Page - updateAvailable) { ?> + updateAvailable && $user && $user->isLoggedIn()) { ?> Update