Fixed a (theoretical, not practically relevant for the target use case of Grocy) SQL injection possibility (closes #2259)

This commit is contained in:
Bernd Bestel 2023-06-22 15:07:47 +02:00
parent 297cc57244
commit c415e2f8da
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -892,7 +892,7 @@ class StockService extends BaseService
return FindAllObjectsInArrayByPropertyValue($stockEntries, 'location_id', $locationId);
}
public function GetProductStockLocations($productId, $allowSubproductSubstitution = false)
public function GetProductStockLocations(int $productId, $allowSubproductSubstitution = false)
{
$sqlWhereProductId = 'product_id = ' . $productId;
if ($allowSubproductSubstitution)