mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 10:48:26 +00:00
settings-api: fix wrong code
`ids` is an array so `id` is the value when using a for...of loop. Also, switch to Number.isInteger since we expect the IDs to be numbers Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -212,11 +212,9 @@ function deleteMultipleSessions(ids) {
|
||||
// Check input validity
|
||||
if (!Array.isArray(ids)) return;
|
||||
|
||||
// Exploit prevention: Return early for non-numeric IDs
|
||||
// Exploit prevention: return early for non-numeric IDs
|
||||
for (const id of ids) {
|
||||
// TODO Fix eslint
|
||||
// eslint-disable-next-line unicorn/prefer-number-properties
|
||||
if (Object.hasOwn(ids, id) && isNaN(ids[id])) return;
|
||||
if (!Number.isInteger(id)) return;
|
||||
}
|
||||
|
||||
// Convert all ids to integers
|
||||
|
||||
Reference in New Issue
Block a user