Allow German Umlauts in OOF plugin product names (fixes #2740)

This commit is contained in:
Bernd Bestel
2025-06-07 18:00:38 +02:00
parent ad0447497c
commit 6b18b0a7be
2 changed files with 2 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
### Stock ### Stock
- 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 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 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
### Shopping list ### Shopping list

View File

@@ -58,7 +58,7 @@ class OpenFoodFactsBarcodeLookupPlugin extends BaseBarcodeLookupPlugin
} }
// Remove non-ASCII characters in product name (whyever a product name should have them at all) // Remove non-ASCII characters in product name (whyever a product name should have them at all)
$name = preg_replace('/[^\x20-\x7E]/', '', $name); $name = preg_replace('/[^a-zA-Z0-9äöüÄÖÜß ]/', '', $name);
return [ return [
'name' => $name, 'name' => $name,