From 2aa3bce5f742a48b8b1bb9ab2aa3f4c9fd2a6e62 Mon Sep 17 00:00:00 2001 From: Knah-Tsaeb Date: Tue, 3 Dec 2024 16:56:41 +0100 Subject: [PATCH] Test empty var --- app/Utils/Selected.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Utils/Selected.php b/app/Utils/Selected.php index 5eaae74..0073e10 100644 --- a/app/Utils/Selected.php +++ b/app/Utils/Selected.php @@ -6,11 +6,11 @@ class Selected { static function selected($var, $ref) { $testPostsPage = explode('/', $ref); - if ($testPostsPage[1] === 'post') { + if (isset($testPostsPage[1]) && $testPostsPage[1] === 'post') { $ref = '/posts'; } if ($var === $ref) { return 'active'; } } -} +} \ No newline at end of file