mirror of
https://github.com/grocy/grocy.git
synced 2026-03-27 23:29:25 +01:00
This commit is contained in:
parent
b1e3ef7881
commit
bf96ff5b92
|
|
@ -14,7 +14,7 @@
|
|||
- External barcode lookup plugin optimizations:
|
||||
- When an image URL without a file extension is returned, the file extension is now determined by the Content-Type header (if any) (thanks @jordy-u for the idea)
|
||||
- Data URLs for images are now supported (`data:image/png;base64,xxxx`) (thanks @GammaC0de)
|
||||
- Fixed that German Umlauts were removed from product names when looking up a barcode via the built-in Open Food Facts external barcode lookup plugin
|
||||
- Fixed that German Umlauts and other special characters were removed from product names when looking up a barcode via the built-in Open Food Facts external barcode lookup plugin
|
||||
- Fixed that when using/scanning a barcode on the purchase page with a note attached (which prefills the note field) and when manually selecting another product afterwards, the note of the previously used barcode was incorrectly prefilled again
|
||||
- Fixed that the "next input focus handling" (jumping to the next input after entering a value) didn't work at some places (e.g. after entering a purchased date on the purchase page)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class OpenFoodFactsBarcodeLookupPlugin extends BaseBarcodeLookupPlugin
|
|||
|
||||
// Guzzle throws exceptions for connection errors, so nothing to do on that here
|
||||
|
||||
$data = json_decode($response->getBody());
|
||||
$data = json_decode(mb_convert_encoding($response->getBody(), 'UTF-8', 'UTF-8'));
|
||||
if ($statusCode == 404 || $data->status != 1)
|
||||
{
|
||||
// Nothing found for the given barcode
|
||||
|
|
@ -57,9 +57,6 @@ class OpenFoodFactsBarcodeLookupPlugin extends BaseBarcodeLookupPlugin
|
|||
$name = $data->product->$productNameFieldLocalized;
|
||||
}
|
||||
|
||||
// Remove non-ASCII characters in product name (whyever a product name should have them at all)
|
||||
$name = preg_replace('/[^a-zA-Z0-9äöüÄÖÜß ]/', '', $name);
|
||||
|
||||
return [
|
||||
'name' => $name,
|
||||
'location_id' => $locationId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user