Update tcpdf.php

Add an additional empty test to prevent error in PHP 7.2. Without this test, the variables might get initialized as an empty string, which will lead to an error during the following multiplication.
There might be more lines with this problem - these are the ones I found.
This commit is contained in:
Sören Bernstein 2018-11-19 15:22:07 +01:00 committed by GitHub
parent 367241059c
commit 21bb4fdfd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18686,7 +18686,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$hbz = 0; // distance from y to line bottom
$hb = 0; // vertical space between block tags
// calculate vertical space for block tags
if (isset($this->tagvspaces[$tag['value']][0]['h']) AND ($this->tagvspaces[$tag['value']][0]['h'] >= 0)) {
if (isset($this->tagvspaces[$tag['value']][0]['h']) && !empty($this->tagvspaces[$tag['value']][0]['h']) && ($this->tagvspaces[$tag['value']][0]['h'] >= 0)) {
$cur_h = $this->tagvspaces[$tag['value']][0]['h'];
} elseif (isset($tag['fontsize'])) {
$cur_h = $this->getCellHeight($tag['fontsize'] / $this->k);
@ -18718,7 +18718,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
}
// closing vertical space
$hbc = 0;
if (isset($this->tagvspaces[$tag['value']][1]['h']) AND ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) {
if (isset($this->tagvspaces[$tag['value']][1]['h']) && !empty($this->tagvspaces[$tag['value']][1]['h']) && ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) {
$pre_h = $this->tagvspaces[$tag['value']][1]['h'];
} elseif (isset($parent['fontsize'])) {
$pre_h = $this->getCellHeight($parent['fontsize'] / $this->k);
@ -19379,7 +19379,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$hbz = 0; // distance from y to line bottom
$hb = 0; // vertical space between block tags
// calculate vertical space for block tags
if (isset($this->tagvspaces[$tag['value']][1]['h']) AND ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) {
if (isset($this->tagvspaces[$tag['value']][1]['h']) && !empty($this->tagvspaces[$tag['value']][1]['h']) && ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) {
$pre_h = $this->tagvspaces[$tag['value']][1]['h'];
} elseif (isset($parent['fontsize'])) {
$pre_h = $this->getCellHeight($parent['fontsize'] / $this->k);