summaryrefslogtreecommitdiffstats
path: root/51.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-01-02 14:16:53 +0100
committerRemi Collet <remi@remirepo.net>2020-01-02 14:16:53 +0100
commit014c63239ba7656e882cb3dbdc79d47839ea0408 (patch)
tree5bbdb413057993705850b2b39fa66b20286378c9 /51.patch
parent273d9080d0d45b1a2664b2749cf5d054925600d7 (diff)
- update to 1.15.18
- add patch for 7.4 from https://github.com/tecnickcom/tc-lib-barcode/pull/51
Diffstat (limited to '51.patch')
-rw-r--r--51.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/51.patch b/51.patch
new file mode 100644
index 0000000..6b87e67
--- /dev/null
+++ b/51.patch
@@ -0,0 +1,31 @@
+From 7c1c7693ca684c778d59a35accec6622f9879877 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 2 Jan 2020 14:10:52 +0100
+Subject: [PATCH] skip non hexa char. for 7.4
+
+---
+ src/Type/Linear/MsiCheck.php | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/src/Type/Linear/MsiCheck.php b/src/Type/Linear/MsiCheck.php
+index f658f90..9725fa9 100644
+--- a/src/Type/Linear/MsiCheck.php
++++ b/src/Type/Linear/MsiCheck.php
+@@ -77,10 +77,13 @@ protected function getChecksum($code)
+ $pix = 2;
+ $check = 0;
+ for ($pos = ($clen - 1); $pos >= 0; --$pos) {
+- $check += (hexdec($code[$pos]) * $pix);
+- ++$pix;
+- if ($pix > 7) {
+- $pix = 2;
++ $t = $code[$pos];
++ if ($t >= "0" && $t <= "9" || $t >= "a" && $t <= "f" || $t >= "A" && $t <= "F") {
++ $check += (hexdec($t) * $pix);
++ ++$pix;
++ if ($pix > 7) {
++ $pix = 2;
++ }
+ }
+ }
+ $check %= 11;