kazuhikoarase / qrcode-generator

QR Code Generator implementation in JavaScript, Java and more.
https://kazuhikoarase.github.io/qrcode-generator/js/demo/
MIT License
2.1k stars 674 forks source link

PHP coding issues #67

Open liedekef opened 5 years ago

liedekef commented 5 years ago

Some issues with the code: 1) To avoid a pass-by-reference warning in php 7, in the function addData the case-statement should be something like this (the "new" as a separate call):

        case QR_MODE_NUMBER :
        $d = new QRNumber($data);
            $this->addDataImpl($d);
            break;

        case QR_MODE_ALPHA_NUM :
        $d = new QRAlphaNum($data);
            $this->addDataImpl($d);
            break;

        case QR_MODE_8BIT_BYTE :
        $d = new QR8BitByte($data);
            $this->addDataImpl($d);
            break;

        case QR_MODE_KANJI :
        $d = new QRKanji($data);
            $this->addDataImpl($d);
            break;

2) When coding a string like https://my.url.site/events/?eme_check_attendance=1&eme_pmt_rndid=5c4ac78bdaef8_8a5fe7041234573e19e7f9db6ba4fe38 I got an error: PHP Fatal error: code length overflow. (988]72) in qrcode.php on line 362 (I find the 988 very weird, and the 72 very small). I use this as a call: $qr = QRCode::getMinimumQRCode($my_example_url,QR_ERROR_CORRECT_LEVEL_H); Is this a bug?