From bebf6dd4a444339555004da601b0f7a7a380967a Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 2 Sep 2023 11:28:29 +0700 Subject: [PATCH] Fixed empty $row['pm_count'] (#880) --- library/includes/page_header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/includes/page_header.php b/library/includes/page_header.php index 555292c6b..5b4e02ddb 100644 --- a/library/includes/page_header.php +++ b/library/includes/page_header.php @@ -78,7 +78,7 @@ if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) { } } if (!$have_new_pm && $userdata['user_unread_privmsg']) { - // synch unread pm count + // sync unread pm count if (defined('IN_PM')) { $row = DB()->fetch_row(" SELECT COUNT(*) AS pm_count @@ -88,7 +88,7 @@ if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) { GROUP BY privmsgs_to_userid "); - $real_unread_pm_count = (int)$row['pm_count']; + $real_unread_pm_count = (int)$row['pm_count'] ?? 0; if ($userdata['user_unread_privmsg'] != $real_unread_pm_count) { $userdata['user_unread_privmsg'] = $real_unread_pm_count;