From e5145b19a28c131f738c22ba89dd74bfb6722bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20Gangs=C3=B8?= Date: Fri, 19 Sep 2025 10:41:26 +0200 Subject: [PATCH] Do not use AlphaNum when string contains comma Using dash in this context will create a range between `+` and `.` which allows the following characters: `+`, `,`, `-`, `.`. The ASCII range is as follow: + (43), , (44), - (45), . (46). Comma is not supported and will then crash in `write()`. (cherry picked from commit 03e84852b4e8394444eadc71ae3c66c19edf954f) --- src/Data/AlphaNum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/AlphaNum.php b/src/Data/AlphaNum.php index 93ef9fc59..6dc60e9fe 100644 --- a/src/Data/AlphaNum.php +++ b/src/Data/AlphaNum.php @@ -44,7 +44,7 @@ final class AlphaNum extends QRDataModeAbstract{ * @inheritDoc */ public static function validateString(string $string):bool{ - return (bool)preg_match('/^[A-Z\d %$*+-.:\/]+$/', $string); + return (bool)preg_match('/^[A-Z\d %$*+\-.:\/]+$/', $string); } /**