MDL-76495 libs: patch TCPDF for PHP 8.1 compatibility

This commit is contained in:
Marina Glancy 2022-11-28 16:01:47 +01:00
parent 6989097a3c
commit cfe0945ffb
2 changed files with 4 additions and 2 deletions

View File

@ -884,14 +884,14 @@ class QRcode {
protected function getCode() {
if ($this->count < $this->dataLength) {
$row = $this->count % $this->blocks;
$col = $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];
} elseif ($this->count < $this->dataLength + $this->eccLength) {
$row = ($this->count - $this->dataLength) % $this->blocks;
$col = ($this->count - $this->dataLength) / $this->blocks;
$col = (int)(($this->count - $this->dataLength) / $this->blocks);
$ret = $this->rsblocks[$row]['ecc'][$col];
} else {
return 0;

View File

@ -6,6 +6,8 @@ Description of TCPDF library import
* remove all fonts that were not already present
* visit http://127.0.0.1/lib/tests/other/pdflibtestpage.php and view the pdf
* modify getTCPDFProducer lib/tcpdf/include/tcpdf_static.php to remove the version number
* Check the status of https://github.com/tecnickcom/TCPDF/pull/548 , apply if it is still
not included or delete this entry
Important
---------