mpdf / mpdf

PHP library generating PDF files from UTF-8 encoded HTML
https://mpdf.github.io
GNU General Public License v2.0
4.4k stars 1.07k forks source link

Bug in Mpdf::transformRotate: Unsupported operand types: string * int #2056

Open fabiofreedev opened 1 month ago

fabiofreedev commented 1 month ago

Guidelines

Description of the bug

The method transformRotate doesn't support the revert value nor revert !important.

It treats it as if it were an angle and fails on line 26772

mPDF version

8.2.1

PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

Laravel on PHP 8.3

Reproducible PHP+CSS+HTML snippet suffering by the error

Code

$mpdf->WriteHTML(htmlspecialchars_decode($content));

Content

<!DOCTYPE html><html><head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Test</title>

</head>

<body data-gr-ext-installed="" data-new-gr-c-s-check-loaded="14.1172.0">

<table border="0" cellspacing="0" cellpadding="0" width="100%" style=" aspect-ratio: revert !important; background: revert !important; block-size: revert !important; border: revert !important; bottom: revert !important; color: revert !important; color-scheme: revert !important; content-visibility: revert !important; cursor: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; height: revert !important; hyphens: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important;">
    <tr>
        <td>Test</td>
    </tr>
</table>
finwe commented 1 month ago

Well, no wonder.

Will try to at least ignore this.