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

php 8+ edge cases fixes #630

Closed bruno-farias closed 1 year ago

bruno-farias commented 1 year ago

This PR fixes issues with division by zero, returns from function pregSplit to match the expected, and calculates maximum width for a single character on the string will not throw an error when the variable is not countable

edoniti commented 1 year ago

@williamdes I am having a problem that is solved from this pull request (max function throwing an error because of the empty array). Can we except this to be merged to the main branch?

williamdes commented 1 year ago

Hi @nicolaasuni Would you mind giving a review of pending PRs?

kallesommernielsen commented 1 year ago

Just encountered this issue for some our customers at Fixably too after upgrading to PHP8. I tested the changes from this PR and confirm it works on our end so it would be lovely if this PR could get reviewed and merged.

I left an in-line review that also fixes another minor issue, that this PR doesn't fully resolve