tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.22k stars 1.52k forks source link

Undefined offset: -1 #603

Open gemal opened 1 year ago

gemal commented 1 year ago

using version 6.6.2

if you call MultiCell with the following text: Festival - ​​​​​​​Vi glæder os til at feste med jer!

note that in this string are some zero with spaces: https://en.wikipedia.org/wiki/Zero-width_space

image

you get: Undefined offset: -1

stacktrace: vendor\tecnickcom\tcpdf\tcpdf.php:6292 vendor\tecnickcom\tcpdf\tcpdf.php:6355 vendor\tecnickcom\tcpdf\tcpdf.php:5942

gemal commented 1 year ago

if it helps perhaps I somehow can make a test case out of this?

williamdes commented 1 year ago

if it helps perhaps I somehow can make a test case out of this?

For sure ! You can create an example file like this one: https://github.com/tecnickcom/TCPDF/blob/main/examples/example_066.php If it reproduces the bug you can create a PR for it (and it's fix ?)

gemal commented 1 year ago

example_069.txt

test file

gemal commented 1 year ago

how can I continue on this? how do I run the unit tests?

williamdes commented 1 year ago

how can I continue on this? how do I run the unit tests?

Hi, my appologies for not replying ealier The best is to create a pull-request and put the example file in it, the tests will be run automatically And we can discuss on it quicker