diff options
author | Andrew Dolgov <[email protected]> | 2013-05-07 01:34:49 -0700 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-05-07 01:34:49 -0700 |
commit | a4fd183b5853867a9293dba438512d8400e6b65e (patch) | |
tree | 9776db47df16c7daa91f7a0e2c257031be75d33e /lib/phpqrcode/phpqrcode.php | |
parent | 75933cf00d4331fd27821af03cadbb2e7c83da79 (diff) | |
parent | 6f7798b6434f5ef6073447998c436901b507e3df (diff) |
Merge pull request #180 from rlerdorf/master
Fix some bugs found by static analysis
Diffstat (limited to 'lib/phpqrcode/phpqrcode.php')
-rw-r--r-- | lib/phpqrcode/phpqrcode.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/phpqrcode/phpqrcode.php b/lib/phpqrcode/phpqrcode.php index 80adb9df2..02b877639 100644 --- a/lib/phpqrcode/phpqrcode.php +++ b/lib/phpqrcode/phpqrcode.php @@ -2195,7 +2195,7 @@ case QR_MODE_NUM: $length = $this->eatNum(); break;
case QR_MODE_AN: $length = $this->eatAn(); break;
case QR_MODE_KANJI:
- if ($hint == QR_MODE_KANJI)
+ if ($this->modeHint == QR_MODE_KANJI)
$length = $this->eatKanji();
else $length = $this->eat8();
break;
@@ -2217,7 +2217,7 @@ $p = 0;
while ($p<$stringLen) {
- $mode = self::identifyMode(substr($this->dataStr, $p), $this->modeHint);
+ $mode = self::identifyMode(substr($this->dataStr, $p));
if($mode == QR_MODE_KANJI) {
$p += 2;
} else {
@@ -2621,13 +2621,13 @@ if (file_exists($fileName)) {
$bitMask = self::unserial(file_get_contents($fileName));
} else {
- $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d);
+ $bitMask = $this->generateMaskNo($maskNo, $width, $s);
if (!file_exists(QR_CACHE_DIR.'mask_'.$maskNo))
mkdir(QR_CACHE_DIR.'mask_'.$maskNo);
file_put_contents($fileName, self::serial($bitMask));
}
} else {
- $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d);
+ $bitMask = $this->generateMaskNo($maskNo, $width, $s);
}
if ($maskGenOnly)
@@ -2937,7 +2937,7 @@ //----------------------------------------------------------------------
public function getCode()
{
- $ret;
+ $ret = 0;
if($this->count < $this->dataLength) {
$row = $this->count % $this->blocks;
@@ -3059,7 +3059,7 @@ $input = new QRinput($version, $level);
if($input == NULL) return NULL;
- $ret = $input->append($input, QR_MODE_8, strlen($string), str_split($string));
+ $ret = $input->append(QR_MODE_8, strlen($string), str_split($string));
if($ret < 0) {
unset($input);
return NULL;
|