From b142eba80f5e0bd7cee180d2f045d79367a5bad9 Mon Sep 17 00:00:00 2001 From: Daniel Salerno Date: Wed, 6 Sep 2023 10:20:02 +0200 Subject: [PATCH] Fix non-numeric value warning (#627) * Fix non-numeric value warning Fixes this warning on generating PDF: Warning: A non-numeric value encountered in /tcpdf/tcpdf.php on line 5473 * Better fix for non-numeric value warning Fixes this warning on generating PDF after calling `Text` with a non-numeric value for `$fstroke`: Warning: A non-numeric value encountered in /tcpdf/tcpdf.php on line 5470 * Update tcpdf.php Co-authored-by: William Desportes --------- Co-authored-by: William Desportes Co-authored-by: Nicola Asuni --- tcpdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcpdf.php b/tcpdf.php index 23194bd2..057182a8 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -22057,7 +22057,7 @@ public function getNumberOfColumns() { public function setTextRenderingMode($stroke=0, $fill=true, $clip=false) { // Ref.: PDF 32000-1:2008 - 9.3.6 Text Rendering Mode // convert text rendering parameters - if ($stroke < 0) { + if ($stroke < 0 || !is_numeric($stroke)) { $stroke = 0; } if ($fill === true) {