Skip to content

Commit

Permalink
Merge pull request #78 from andreybolonin/master
Browse files Browse the repository at this point in the history
fix php 7.4 deprecations
  • Loading branch information
khanamiryan committed Apr 19, 2020
2 parents b934ef5 + e3e100a commit 89b57f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Common/BitMatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function parse($stringRepresentation, $setString, $unsetString)
$nRows = 0;
$pos = 0;
while ($pos < strlen($stringRepresentation)) {
if ($stringRepresentation{$pos} == '\n' ||
if ($stringRepresentation[$pos] == '\n' ||
$stringRepresentation->{$pos} == '\r') {
if ($bitsPos > $rowStartPos) {
if ($rowLength == -1) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Qrcode/Decoder/DecodedBitStreamParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ private static function decodeAlphanumericSegment($bits,
if ($fc1InEffect) {
// We need to massage the result a bit if in an FNC1 mode:
for ($i = $start; $i < strlen($result); $i++) {
if ($result{$i} == '%') {
if ($i < strlen($result) - 1 && $result{$i + 1} == '%') {
if ($result[$i] == '%') {
if ($i < strlen($result) - 1 && $result[$i + 1] == '%') {
// %% is rendered as %
$result = substr_replace($result, '', $i + 1, 1);//deleteCharAt(i + 1);
} else {
Expand Down

0 comments on commit 89b57f2

Please sign in to comment.