diff --git a/services/StockService.php b/services/StockService.php index 2261db4e..77178951 100644 --- a/services/StockService.php +++ b/services/StockService.php @@ -626,7 +626,7 @@ class StockService extends BaseService { $webClient = new Client(); $response = $webClient->request('GET', $pluginOutput['__image_url'], ['headers' => ['User-Agent' => 'Grocy/' . $this->getApplicationService()->GetInstalledVersion()->Version . ' (https://grocy.info)']]); - $fileName = $pluginOutput['__barcode'] . '.' . pathinfo($pluginOutput['__image_url'], PATHINFO_EXTENSION); + $fileName = $pluginOutput['__barcode'] . '.' . pathinfo(explode('?', $pluginOutput['__image_url'])[0], PATHINFO_EXTENSION); file_put_contents($this->getFilesService()->GetFilePath('productpictures', $fileName), $response->getBody()); $productData['picture_file_name'] = $fileName; }