New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 7.2 Warning : count(): Parameter must be an array or an object that implements Countable #562
Comments
Can you please post your PHP/HTML code? I would like to know if the cause of this is not somewhere earlier in the code rather than just checking for NULL. |
I've isolated a piece of my HTML/PHP code that doesn't work : HTML : <!DOCTYPE html>
<html>
<head>
<style>
div, table {
font-size: 8.5pt;
font-family: "Arial";
}
</style>
</head>
<body>
<div class="bill">
<div class="header">
<div class="logo">
<img src="" />
</div>
</div>
</div>
</body>
</html> PHP : $mpdf = new Mpdf([
'format' => 'A4',
'margin_left' => 7,
'margin_right' => 7,
'margin_top' => 7,
'margin_bottom' => 7,
'margin_header' => 0,
'margin_footer' => 3
]);
$mpdf->WriteHTML($html);
$mpdf->Output($file, Destination::FILE); If I remove the following line : |
What happens if you try: |
Exactly the same problem. I tried another font, but it doesn't work anymore. |
Added the check, although I was not able to reproduce the issue. |
I got the same issue after upgrading to php7.2 on mac os x. |
@vukanac Not particularly helpful. Show your library version and code snippet causing this. The check is not yet released IIRC. |
I'm having the same issue. It happens only when the CSS specifies a font that is not installed. |
Last time when this issue was solved, the following test was added: |
I've released v7.0.3 where the check for NULL is incorporated. |
I am facing this issue while installing drupal-7.56. at line 1441 of "C:\xampp\htdocs\drupal\drupal-7.56\includes\form.inc)." |
Please update to the last release of mpdf. If it is not solved, than it is a similar issue popping up from different location in the code. |
Yeah sure i will do that. |
Hello,
I'm using the latest version of mpdf (7.0.2) with PHP 7.2 and I found a bug.
It's happening at line 5788 of Mpdf.php (very begining of the
trimOTLdata()
method) :The problem is that
$cOTLdata['char_data']
could be null in some cases, and PHP 7.2 doesn't allowcount(null)
By changing this line to :
... it solves the problem, but I don't know enough about the project to make a pull request.
Hope this will be helpful !
The text was updated successfully, but these errors were encountered: