mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-19 08:00:04 +00:00
:octocat: QRCode::isByte(): string "0" fails with empty()
This commit is contained in:
+1
-1
@@ -307,7 +307,7 @@ class QRCode{
|
||||
* a dummy
|
||||
*/
|
||||
public function isByte(string $data):bool{
|
||||
return !empty($data);
|
||||
return $data !== '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ class QRCodeTest extends TestCase{
|
||||
public function testIsByte():void{
|
||||
$this::assertTrue($this->qrcode->isByte("\x01\x02\x03"));
|
||||
$this::assertTrue($this->qrcode->isByte(' ')); // not empty!
|
||||
$this::assertTrue($this->qrcode->isByte('0'));
|
||||
|
||||
$this::assertFalse($this->qrcode->isByte(''));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user