mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/17465] Throw bad request exceptions on invalid data requests
PHPBB-17465
This commit is contained in:
parent
0c1aeb862b
commit
ac3e9f64d8
1 changed files with 10 additions and 0 deletions
|
@ -165,6 +165,11 @@ class webpush
|
||||||
$notification_data = $this->db->sql_fetchfield('push_data');
|
$notification_data = $this->db->sql_fetchfield('push_data');
|
||||||
$this->db->sql_freeresult($result);
|
$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);
|
return $this->get_notification_data($notification_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,6 +197,11 @@ class webpush
|
||||||
$notification_row = $this->db->sql_fetchrow($result);
|
$notification_row = $this->db->sql_fetchrow($result);
|
||||||
$this->db->sql_freeresult($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'];
|
$notification_data = $notification_row['push_data'];
|
||||||
$push_token = $notification_row['push_token'];
|
$push_token = $notification_row['push_token'];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue