Fix some suggestions / ignore others

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2022-04-22 17:17:59 +01:00
parent 17e59dde03
commit 242654e149
5 changed files with 7 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ if ($_POST['action'] == 'delete_message' && isset($_POST['id'])) {
$ids = json_decode($_POST['id']);
if(!is_array($ids))
throw new Exception('Invalid payload: id is not an array');
// Explot prevention: Ensure all entries in the ID array are integers
// Exploit prevention: Ensure all entries in the ID array are integers
foreach($ids as $value) {
if (!is_numeric($value))
throw new Exception('Invalid payload: id contains non-numeric entries');