From 2b6b8df4b57b24f38f10980fd0517b0585c8cf22 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Tue, 30 Mar 2021 15:26:01 -0500 Subject: [PATCH] Fix printer state error (#12681) --- includes/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index 5730b7b44b..a038bab960 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1624,6 +1624,12 @@ function q_bridge_bits2indices($hex_data) * ie. '9a00' -> '100110100000' -> array(1, 4, 5, 7) */ $hex_data = str_replace(' ', '', $hex_data); + + // we need an even number of digits for hex2bin + if (strlen($hex_data) % 2 === 1) { + $hex_data = '0' . $hex_data; + } + $value = hex2bin($hex_data); $length = strlen($value); $indices = [];