Skip to content

Commit

Permalink
Fix possible casting issues in codabar #92
Browse files Browse the repository at this point in the history
  • Loading branch information
casperbakker committed Jan 11, 2020
1 parent 77157d2 commit d96798a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Types/TypeCodabar.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public function getBarcodeData(string $code): Barcode
$code = 'A' . strtoupper($code) . 'A';

for ($i = 0; $i < strlen($code); ++$i) {
if (! isset($this->conversionTable[$code[$i]])) {
if (! isset($this->conversionTable[(string)$code[$i]])) {
throw new InvalidCharacterException('Char ' . $code[$i] . ' is unsupported');
}

$seq = $this->conversionTable[$code[$i]];
$seq = $this->conversionTable[(string)$code[$i]];
for ($j = 0; $j < 8; ++$j) {
if (($j % 2) == 0) {
$t = true; // bar
Expand Down

0 comments on commit d96798a

Please sign in to comment.