diff --git a/src/Common/MaskPattern.php b/src/Common/MaskPattern.php index 8441a7f53..5c3ea93c1 100644 --- a/src/Common/MaskPattern.php +++ b/src/Common/MaskPattern.php @@ -77,7 +77,7 @@ final class MaskPattern{ */ public function __construct(int $maskPattern){ - if((0b111 & $maskPattern) !== $maskPattern){ + if(($maskPattern & 0b111) !== $maskPattern){ throw new QRCodeException('invalid mask pattern'); } diff --git a/src/Data/QRMatrix.php b/src/Data/QRMatrix.php index 9d052b90e..bcf141cda 100755 --- a/src/Data/QRMatrix.php +++ b/src/Data/QRMatrix.php @@ -349,7 +349,7 @@ class QRMatrix{ $ix += $x; $iy += $y; - // $M_TYPE is given, skip if the field is not the same type + // check if the field is the same type if($M_TYPE !== null && !$this->checkType($ix, $iy, $M_TYPE)){ continue; }