diff --git a/phpBB/phpbb/ucp/controller/webpush.php b/phpBB/phpbb/ucp/controller/webpush.php index 50d3eb3739..c36f67d129 100644 --- a/phpBB/phpbb/ucp/controller/webpush.php +++ b/phpBB/phpbb/ucp/controller/webpush.php @@ -165,6 +165,11 @@ class webpush $notification_data = $this->db->sql_fetchfield('push_data'); $this->db->sql_freeresult($result); + if (!$notification_data) + { + throw new http_exception(Response::HTTP_BAD_REQUEST, 'AJAX_ERROR_TEXT'); + } + return $this->get_notification_data($notification_data); } @@ -192,6 +197,11 @@ class webpush $notification_row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); + if (!$notification_row || !isset($notification_row['push_data']) || !isset($notification_row['push_token'])) + { + throw new http_exception(Response::HTTP_BAD_REQUEST, 'AJAX_ERROR_TEXT'); + } + $notification_data = $notification_row['push_data']; $push_token = $notification_row['push_token'];