mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-03 05:55:16 +01:00
Ensure that the ids passed to DBElementRepository::findByIDInMatchingOrder are all ints
This might help to diagnose #1188
This commit is contained in:
@@ -109,6 +109,13 @@ class DBElementRepository extends EntityRepository
|
||||
return [];
|
||||
}
|
||||
|
||||
//Ensure that all IDs are integers and none is null
|
||||
foreach ($ids as $id) {
|
||||
if (!is_int($id)) {
|
||||
throw new \InvalidArgumentException('Non-integer ID given to findByIDInMatchingOrder: ' . var_export($id, true));
|
||||
}
|
||||
}
|
||||
|
||||
$cache_key = implode(',', $ids);
|
||||
|
||||
//Check if the result is already cached
|
||||
|
||||
Reference in New Issue
Block a user