From 21bb4fdfd505eb67bec603deffc57ce4ff0d408c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Bernstein?= Date: Mon, 19 Nov 2018 15:22:07 +0100 Subject: [PATCH] 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. --- tcpdf.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcpdf.php b/tcpdf.php index 24ef434..a1b4c1c 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -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);