mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-24 11:17:52 +00:00
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()`.
This commit is contained in:
@@ -36,7 +36,7 @@ final class AlphaNum extends QRDataModeAbstract{
|
||||
}
|
||||
|
||||
public static function validateString(string $string):bool{
|
||||
return (bool)preg_match('/^[A-Z\d %$*+-.:\/]+$/', $string);
|
||||
return (bool)preg_match('/^[A-Z\d %$*+\-.:\/]+$/', $string);
|
||||
}
|
||||
|
||||
public function write(BitBuffer $bitBuffer, int $versionNumber):static{
|
||||
|
||||
Reference in New Issue
Block a user