From eab739f83a43a9e2d0bfb79fa8d9d520f2a73189 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Mon, 13 Mar 2023 14:40:50 +0100 Subject: [PATCH] fix(configuration): #74 fatal error when the CHANNELS is not defined Closes: #74 --- src/functions/redirect.php | 10 ++++++---- src/pages/changelog.php | 11 +++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/functions/redirect.php b/src/functions/redirect.php index c8656f84..be639c2f 100644 --- a/src/functions/redirect.php +++ b/src/functions/redirect.php @@ -19,10 +19,12 @@ function redirect(string $target) $isHostInChannel = false; /** Determine if host is a defined channel */ - foreach (CHANNELS as $channel) { - if ($channel['host'] === $_SERVER['HTTP_HOST']) { - $isHostInChannel = true; - break; + if (defined('CHANNELS') && is_array(CHANNELS)) { + foreach (CHANNELS as $channel) { + if ($channel['host'] === $_SERVER['HTTP_HOST']) { + $isHostInChannel = true; + break; + } } } diff --git a/src/pages/changelog.php b/src/pages/changelog.php index 055f4cd1..387ea6e7 100644 --- a/src/pages/changelog.php +++ b/src/pages/changelog.php @@ -118,6 +118,17 @@ $page->navigation(); #64 + +

+