mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-18 15:41:26 +02:00
[ticket/17465] Throw bad request exceptions on invalid data requests
PHPBB-17465
This commit is contained in:
@@ -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'];
|
||||
|
||||
|
Reference in New Issue
Block a user