Skip to content

Commit de3dd9a

Browse files
committed
:octocat: QRCode::isByte(): string "0" fails with empty()
1 parent a614d1e commit de3dd9a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/QRCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public function isKanji(string $string):bool{
307307
* a dummy
308308
*/
309309
public function isByte(string $data):bool{
310-
return !empty($data);
310+
return $data !== '';
311311
}
312312

313313
}

tests/QRCodeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function testIsKanji():void{
7474
public function testIsByte():void{
7575
$this::assertTrue($this->qrcode->isByte("\x01\x02\x03"));
7676
$this::assertTrue($this->qrcode->isByte(' ')); // not empty!
77+
$this::assertTrue($this->qrcode->isByte('0'));
7778

7879
$this::assertFalse($this->qrcode->isByte(''));
7980
}

0 commit comments

Comments
 (0)