Skip to content

Commit

Permalink
Fix non-numeric value warning (#627)
Browse files Browse the repository at this point in the history
* 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 <williamdes@wdes.fr>

---------

Co-authored-by: William Desportes <williamdes@wdes.fr>
Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 6, 2023
1 parent 9c7982d commit b142eba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b142eba

Please sign in to comment.