Eliminate some more Notice-level PHP errors

This commit is contained in:
Juribiyan 2022-01-06 16:22:24 +05:00
parent 51994e754b
commit 6b2997d441
2 changed files with 3 additions and 2 deletions

View File

@ -5012,7 +5012,8 @@ class Manage {
// Get the number of bans in the database of this type // 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 . "'"); $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 // 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) { if (count($results) > 0) {

View File

@ -37,7 +37,7 @@ $pages = array(
'body' => 'register' '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']; $title = $page['title'];
$pattern = 'pages/patterns/'.$page['pattern'].'.php'; $pattern = 'pages/patterns/'.$page['pattern'].'.php';
$body = 'pages/contents/'.$page['body'].'.php'; $body = 'pages/contents/'.$page['body'].'.php';