瀏覽代碼

Fix trailing zero when not CODE_128_C

Fix trailing zero when not CODE_128_C
master
Gustavo Arnosti Neves 6 年之前
committed by GitHub
父節點
當前提交
dce7413e3e
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      barcode.php

+ 3
- 3
barcode.php 查看文件

@@ -14,7 +14,7 @@


require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';


define("_BC_VERSION", "1.0.7");
define("_BC_VERSION", "1.0.8");


# default padding for cli messages # default padding for cli messages
define("_BC_PADDING", 30); define("_BC_PADDING", 30);
@@ -340,8 +340,8 @@ function vPrint($input) {
$bc_type = constant('Picqer\Barcode\BarcodeGenerator::TYPE_'.$encoding); $bc_type = constant('Picqer\Barcode\BarcodeGenerator::TYPE_'.$encoding);


// add trailling zero if odd digits on Code128C // add trailling zero if odd digits on Code128C
$bc_string = strlen($bc_string) % 2 == 0 && $encoding === 'CODE_128_C'?
$bc_string : '0'.$bc_string;
$bc_string = strlen($bc_string) % 2 != 0 && $encoding === 'CODE_128_C'?
'0'.$bc_string : $bc_string;


// create appropriate generator // create appropriate generator
$generator = null; $generator = null;


Loading…
取消
儲存