:octocat: Byte: string "0" fails with empty()

This commit is contained in:
smiley
2022-07-23 03:30:58 +02:00
parent 688ffa2315
commit cda00d293a
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ final class Byte extends QRDataModeAbstract{
* @inheritDoc
*/
public static function validateString(string $string):bool{
return !empty($string);
return $string !== '';
}
/**
+1
View File
@@ -27,6 +27,7 @@ final class ByteTest extends DatainterfaceTestAbstract{
return [
["\x01\x02\x03", true],
[' ', true], // not empty!
['0', true], // should survive !empty()
['', false],
];
}