QR Code Plugin for Osclass 5.x (Mindstellar release)
Â
https://github.com/navjottomer/qrcode
It seems that a Decprecated notice has appeared in this plugin, probably due to some update. Lines 140 & 144 of /qrcode/lib/qrencode.php file:
PHP Deprecated: Implicit conversion from float *VARIOUS NUMBERS HERE* to int loses precision.
The old code was:
public function getCode()
{
$ret;
if($this->count < $this->dataLength) {
$row = $this->count % $this->blocks;
$col = $this->count / $this->blocks;
if($col >= $this->rsblocks[0]->dataLength) {
$row += $this->b1;
}
$ret = $this->rsblocks[$row]->data[$col];
} else if($this->count < $this->dataLength + $this->eccLength) {
$row = ($this->count - $this->dataLength) % $this->blocks;
$col = ($this->count - $this->dataLength) / $this->blocks;
$ret = $this->rsblocks[$row]->ecc[$col];
} else {
return 0;
}
$this->count++;
return $ret;
}
}
Â
I have managed to fix this, not 100% sure this is correct but the Notice is gone:
Â
public function getCode()
{
$ret;
if($this->count < $this->dataLength) {
$row = $this->count % $this->blocks;
$col = (int)($this->count / $this->blocks);
if($col >= $this->rsblocks[0]->dataLength) {
$row += $this->b1;
}
$ret = $this->rsblocks[$row]->data[$col];
} else if($this->count < $this->dataLength + $this->eccLength) {
$row = ($this->count - $this->dataLength) % $this->blocks;
$col = (int)(($this->count - $this->dataLength) / $this->blocks);
$ret = $this->rsblocks[$row]->ecc[$col];
} else {
return 0;
}
$this->count++;
return $ret;
}
}
Â
If anyone cares to comment, i would appreciated it.
@alessandro-cagliostro What was updated that caused that notice?
@editor Well this is kinda strange. I only updated Osclasspoint version. PHP is still at 8.0.x, didn't touched that.
So the issue was introduced from Osclasspoint update i guess, not sure why.
You had an "}" missing at the very end. I added it.
