From 6b2997d4414eee070cd02678ef665cf034ca7626 Mon Sep 17 00:00:00 2001 From: Juribiyan Date: Thu, 6 Jan 2022 16:22:24 +0500 Subject: [PATCH] Eliminate some more Notice-level PHP errors --- inc/classes/manage.class.php | 3 ++- index.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/classes/manage.class.php b/inc/classes/manage.class.php index 6eff7d8..61dbbc5 100755 --- a/inc/classes/manage.class.php +++ b/inc/classes/manage.class.php @@ -5012,7 +5012,8 @@ class Manage { // Get the number of bans in the database of this type $hiddenbans = $tc_db->GetAll("SELECT HIGH_PRIORITY COUNT(*) FROM `" . KU_DBPREFIX . "banlist` WHERE `type` = '" . $i . "'"); // Subtract 15 from the count, since we only want the number not shown - $hiddenbans = $hiddenbans[0][0] - 15; + if (is_array($hiddenbans) && is_array($hiddenbans[0])) + $hiddenbans = $hiddenbans[0][0] - 15; } } if (count($results) > 0) { diff --git a/index.php b/index.php index 1eb6630..50d94b6 100644 --- a/index.php +++ b/index.php @@ -37,7 +37,7 @@ $pages = array( 'body' => 'register' ), ); -$page = array_key_exists($_GET['p'], $pages) ? $pages[$_GET['p']] : $pages['boards']; +$page = isset($_GET['p']) && array_key_exists($_GET['p'], $pages) ? $pages[$_GET['p']] : $pages['boards']; $title = $page['title']; $pattern = 'pages/patterns/'.$page['pattern'].'.php'; $body = 'pages/contents/'.$page['body'].'.php';