Skip to content

Commit 03e8485

Browse files
authored
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()`.
1 parent 24d4e6f commit 03e8485

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/AlphaNum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getLengthInBits():int{
3636
}
3737

3838
public static function validateString(string $string):bool{
39-
return (bool)preg_match('/^[A-Z\d %$*+-.:\/]+$/', $string);
39+
return (bool)preg_match('/^[A-Z\d %$*+\-.:\/]+$/', $string);
4040
}
4141

4242
public function write(BitBuffer $bitBuffer, int $versionNumber):static{

0 commit comments

Comments
 (0)