Skip to content

Commit

Permalink
Fix deprecated array access
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandruGG committed Aug 28, 2020
1 parent f1a7eb3 commit 2c3c947
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion tcpdf/include/barcodes/datamatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ protected function lookAheadTest($data, $pos, $mode) {
if ($numch[ENC_C40] == $numch[ENC_X12]) {
$k = ($pos + $charscount + 1);
while ($k < $data_length) {
$tmpchr = ord($data{$k});
$tmpchr = ord($data[$k]);
if ($this->isCharMode($tmpchr, ENC_X12)) {
return ENC_X12;
} elseif (!($this->isCharMode($tmpchr, ENC_X12) OR $this->isCharMode($tmpchr, ENC_C40))) {
Expand Down
4 changes: 2 additions & 2 deletions tcpdf/include/barcodes/pdf417.php
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ protected function getCompaction($mode, $code, $addmode=true) {
$txtarr = array(); // array of characters and sub-mode switching characters
$codelen = strlen($code);
for ($i = 0; $i < $codelen; ++$i) {
$chval = ord($code{$i});
$chval = ord($code[$i]);
if (($k = array_search($chval, $this->textsubmodes[$submode])) !== false) {
// we are on the same sub-mode
$txtarr[] = $k;
Expand Down Expand Up @@ -952,7 +952,7 @@ protected function getCompaction($mode, $code, $addmode=true) {
$cw = array_merge($cw, $cw6);
} else {
for ($i = 0; $i < $sublen; ++$i) {
$cw[] = ord($code{$i});
$cw[] = ord($code[$i]);
}
}
$code = $rest;
Expand Down
6 changes: 3 additions & 3 deletions tcpdf/include/tcpdf_filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public static function decodeFilterLZWDecode($data) {
// convert string to binary string
$bitstring = '';
for ($i = 0; $i < $data_length; ++$i) {
$bitstring .= sprintf('%08b', ord($data{$i}));
$bitstring .= sprintf('%08b', ord($data[$i]));
}
// get the number of bits
$data_length = strlen($bitstring);
Expand Down Expand Up @@ -376,7 +376,7 @@ public static function decodeFilterRunLengthDecode($data) {
$i = 0;
while($i < $data_length) {
// get current byte value
$byte = ord($data{$i});
$byte = ord($data[$i]);
if ($byte == 128) {
// a length value of 128 denote EOD
break;
Expand All @@ -389,7 +389,7 @@ public static function decodeFilterRunLengthDecode($data) {
} else {
// if length is in the range 129 to 255,
// the following single byte shall be copied 257 - length (2 to 128) times during decompression
$decoded .= str_repeat($data{($i + 1)}, (257 - $byte));
$decoded .= str_repeat($data[($i + 1)], (257 - $byte));
// move to next block
$i += 2;
}
Expand Down
2 changes: 1 addition & 1 deletion tcpdf/include/tcpdf_images.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public static function _parsepng($file) {
if ($n > 0) {
$trns = array();
for ($i = 0; $i < $n; ++ $i) {
$trns[] = ord($t{$i});
$trns[] = ord($t[$i]);
}
}
}
Expand Down
Loading

0 comments on commit 2c3c947

Please sign in to comment.