From eeb60edfa88a783065b711fc843e1f61a1793c9d Mon Sep 17 00:00:00 2001 From: codemasher Date: Sun, 5 Apr 2020 23:37:42 +0200 Subject: [PATCH] :wrench: fix mask pattern 2 & 3 according to ISO/IEC 18004:2000 Section 8.8.1 --- src/Data/QRMatrix.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Data/QRMatrix.php b/src/Data/QRMatrix.php index 7e750ba56..a780ff93f 100755 --- a/src/Data/QRMatrix.php +++ b/src/Data/QRMatrix.php @@ -596,6 +596,8 @@ class QRMatrix{ } /** + * ISO/IEC 18004:2000 Section 8.8.1 + * * @see \chillerlan\QRCode\QRMatrix::mapData() * * @internal @@ -615,10 +617,10 @@ class QRMatrix{ // this is literally the same as the stupid switch... return [ $a % 2, - $y % 2, - $x % 3, + $x % 2, + $y % 3, $a % 3, - (floor($y / 2) + floor($x / 3)) % 2, + ((int)($y / 2) + (int)($x / 3)) % 2, $m % 2 + $m % 3, ($m % 2 + $m % 3) % 2, ($m % 3 + $a % 2) % 2