File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff 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 ('#^[ ' . self :: CHAR_MAP . ' ]+$# ' , $ string );
39+ return (bool )preg_match ('/^[A-Z\d %$*+-.:\/ ]+$/ ' , $ string );
4040 }
4141
4242 public function write (BitBuffer $ bitBuffer , int $ versionNumber ):static {
Original file line number Diff line number Diff line change @@ -34,6 +34,15 @@ public static function stringValidateProvider():array{
3434 return [
3535 ['ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 $%*+-./: ' , true ],
3636 ['abc ' , false ],
37+ ['ÄÖÜ ' , false ],
38+ [', ' , true ],
39+ ['- ' , true ],
40+ ['+ ' , true ],
41+ ['. ' , true ],
42+ ['* ' , true ],
43+ [': ' , true ],
44+ ['/ ' , true ],
45+ ['\\' , false ],
3746 ];
3847 }
3948
You can’t perform that action at this time.
0 commit comments