splitbrain / dokuwiki-plugin-dw2pdf

A fork of Luigi Micco's PDF export plugin for DokuWiki
http://www.dokuwiki.org/plugin:dw2pdf
55 stars 68 forks source link

Returns warning after updating into newest PHP version (7.3.16) #392

Closed zdealveindy closed 1 year ago

zdealveindy commented 4 years ago

After updating the server into the latest PHP 7.3.16, the plugin started to return messy output instead of the PDF, starting with warning message:

Warning: count(): Parameter must be an array or an object that implements Countable in /home/davidzel/public_html/anadat-r/lib/plugins/dw2pdf/vendor/mpdf/mpdf/src/Mpdf.php on line 25892

Warning: Cannot modify header information - headers already sent by (output started at /home/davidzel/public_html/anadat-r/lib/plugins/dw2pdf/vendor/mpdf/mpdf/src/Mpdf.php:25892) in /home/davidzel/public_html/anadat-r/lib/plugins/dw2pdf/action.php on line 547

Seems like a compatibility issue of "count" function which has a more strict definition in the latest PHP, unfortunately, I have no idea how this can be fixed (perhaps updating new MPDF library source?). After changing back to PHP 7.1.33, it works fine again (version PHP 7.2.29 returns the same error).

Klap-in commented 1 year ago

I guess that the update to mPDF 8 in August 2020 has fixed these.