From 2f8fc05cdba114e9d7d9d5e8c7259947ec189ccf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Dec 2015 21:28:05 +0100 Subject: [PATCH] Fix: QRcode must not be random --- dev/dolibarr_changes.txt | 7 +++++++ .../includes/tecnickcom/tcpdf/include/barcodes/qrcode.php | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index c7b5e0cd8fc..c5487f67273 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -62,6 +62,13 @@ In htdocs/includes/tcpdf/tcpdf.php * Renamed getmypid into dol_getmypid(). +To avoid to have QRcode changed because generated with a random mask, replace +define('QR_FIND_FROM_RANDOM', 2); +with +define('QR_FIND_FROM_RANDOM', false); + + + TCPDI: ------ Add fpdf_tpl.php 1.2 diff --git a/htdocs/includes/tecnickcom/tcpdf/include/barcodes/qrcode.php b/htdocs/includes/tecnickcom/tcpdf/include/barcodes/qrcode.php index 7ef2759fd6f..9165222e727 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/barcodes/qrcode.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/barcodes/qrcode.php @@ -236,7 +236,7 @@ if (!defined('QRCODEDEFS')) { /** * if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly */ - define('QR_FIND_FROM_RANDOM', 2); + define('QR_FIND_FROM_RANDOM', false); /** * when QR_FIND_BEST_MASK === false @@ -730,7 +730,7 @@ class QRcode { $this->eccLength = $this->rsEccLength($spec); $this->ecccode = array_fill(0, $this->eccLength, 0); $this->blocks = $this->rsBlockNum($spec); - $ret = $this->init($spec); + $ret = $this->init($spec); if ($ret < 0) { return NULL; }