Skip to content

Commit

Permalink
Merge commit from fork
Browse files Browse the repository at this point in the history
Handle alerts validation properly
  • Loading branch information
LiroyvH authored Aug 8, 2024
2 parents 2e19fa8 + 7e29c00 commit 8032867
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Sources/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,10 @@ public static function mark(int|array $members, array|int $to_mark, bool $read):
'',
'UPDATE {db_prefix}user_alerts
SET is_read = {int:read}
WHERE id_alert IN ({array_int:to_mark})',
WHERE id_alert IN ({array_int:to_mark})
AND id_member IN ({array_int:members})',
[
'members' => $members,
'read' => $time,
'to_mark' => $to_mark,
],
Expand Down Expand Up @@ -1097,8 +1099,10 @@ public static function delete(int|array $ids, int|array $members = []): void
Db::$db->query(
'',
'DELETE FROM {db_prefix}user_alerts
WHERE id_alert IN ({array_int:ids})',
WHERE id_alert IN ({array_int:ids})
AND id_member IN ({array_int:members}',
[
'members' => $members,
'ids' => $ids,
],
);
Expand Down Expand Up @@ -1544,8 +1548,10 @@ protected static function deleteInvisible(array &$alerts, int $memID): void
Db::$db->query(
'',
'DELETE FROM {db_prefix}user_alerts
WHERE id_alert IN ({array_int:alerts})',
WHERE id_alert IN ({array_int:alerts})
AND id_member = {int:member}',
[
'member' => $memID,
'alerts' => $deletes,
],
);
Expand Down

0 comments on commit 8032867

Please sign in to comment.