diff --git a/src/Data/Byte.php b/src/Data/Byte.php index 74d799975..9aa850b5c 100644 --- a/src/Data/Byte.php +++ b/src/Data/Byte.php @@ -38,7 +38,7 @@ final class Byte extends QRDataModeAbstract{ * @inheritDoc */ public static function validateString(string $string):bool{ - return !empty($string); + return $string !== ''; } /** diff --git a/tests/Data/ByteTest.php b/tests/Data/ByteTest.php index 58454fe87..3b3c02cea 100644 --- a/tests/Data/ByteTest.php +++ b/tests/Data/ByteTest.php @@ -27,6 +27,7 @@ final class ByteTest extends DatainterfaceTestAbstract{ return [ ["\x01\x02\x03", true], [' ', true], // not empty! + ['0', true], // should survive !empty() ['', false], ]; }