smiley 1 год назад
Родитель
Сommit
991287a774
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      src/Common/MaskPattern.php
  2. 1 1
      src/Data/QRMatrix.php

+ 1 - 1
src/Common/MaskPattern.php

@@ -77,7 +77,7 @@ final class MaskPattern{
 	 */
 	 */
 	public function __construct(int $maskPattern){
 	public function __construct(int $maskPattern){
 
 
-		if((0b111 & $maskPattern) !== $maskPattern){
+		if(($maskPattern & 0b111) !== $maskPattern){
 			throw new QRCodeException('invalid mask pattern');
 			throw new QRCodeException('invalid mask pattern');
 		}
 		}
 
 

+ 1 - 1
src/Data/QRMatrix.php

@@ -349,7 +349,7 @@ class QRMatrix{
 			$ix += $x;
 			$ix += $x;
 			$iy += $y;
 			$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)){
 			if($M_TYPE !== null && !$this->checkType($ix, $iy, $M_TYPE)){
 				continue;
 				continue;
 			}
 			}