Open HuongNV13 opened 1 year ago
Unfortunately mb_str_split() was only introduced in php7.4 which will make swapping this out trickier.
Unfortunately mb_str_split() was only introduced in php7.4 which will make swapping this out trickier.
Thanks for the hint! Okay, some code needs to be added and use PHP_MAJOR_VERSION const and it's friends
or maybe just function_exists()
Thanks, everyone. I have updated the code to use function_exists() to use the correct method.
I think this is not a valid fix as mb_str_split() behaves the same way as str_split() in PHP 8.2 and above. So why dont check if its an empty string (and if its needed in that case). Otherwise you could also write a function str_split_old() which returns array('') if the input string is empty.
Please try to resolve the conflicts. Could you please instead create a wrapper function in tcpdf_static.php?
Hi Nicola, Sorry for the late reply, I was busy with my project. I will update the patch soon.
Thanks,
In PHP 8.2, the str_split function will returns empty arrays for empty strings. See: https://php.watch/versions/8.2/str_split-empty-string-empty-array
We can use mb_str_split() instead