mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-16 21:16:57 +00:00
Update to Php8.5-compatible Dompdf
This commit is contained in:
Generated
+6
-6
@@ -792,16 +792,16 @@
|
||||
},
|
||||
{
|
||||
"name": "dompdf/dompdf",
|
||||
"version": "v3.1.0",
|
||||
"version": "v3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dompdf/dompdf.git",
|
||||
"reference": "a51bd7a063a65499446919286fb18b518177155a"
|
||||
"reference": "794ec856134a73d2a69a474c5d4faa47e1e645b1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/a51bd7a063a65499446919286fb18b518177155a",
|
||||
"reference": "a51bd7a063a65499446919286fb18b518177155a",
|
||||
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/794ec856134a73d2a69a474c5d4faa47e1e645b1",
|
||||
"reference": "794ec856134a73d2a69a474c5d4faa47e1e645b1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -850,9 +850,9 @@
|
||||
"homepage": "https://github.com/dompdf/dompdf",
|
||||
"support": {
|
||||
"issues": "https://github.com/dompdf/dompdf/issues",
|
||||
"source": "https://github.com/dompdf/dompdf/tree/v3.1.0"
|
||||
"source": "https://github.com/dompdf/dompdf/tree/v3.1.1"
|
||||
},
|
||||
"time": "2025-01-15T14:09:04+00:00"
|
||||
"time": "2025-09-20T17:30:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "dompdf/php-font-lib",
|
||||
|
||||
@@ -44,13 +44,6 @@ class Dompdf extends Pdf
|
||||
$orientation = ($orientation == 'L') ? 'landscape' : 'portrait';
|
||||
|
||||
// Create PDF
|
||||
$restoreHandler = false;
|
||||
if (PHP_VERSION_ID >= self::$temporaryVersionCheck) {
|
||||
// @codeCoverageIgnoreStart
|
||||
set_error_handler(self::specialErrorHandler(...));
|
||||
$restoreHandler = true;
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
$pdf = $this->createExternalWriterInstance();
|
||||
$pdf->setPaper($paperSize, $orientation);
|
||||
|
||||
@@ -58,29 +51,8 @@ class Dompdf extends Pdf
|
||||
$pdf->render();
|
||||
|
||||
// Write to file
|
||||
fwrite($fileHandle, $pdf->output() ?? '');
|
||||
fwrite($fileHandle, $pdf->output());
|
||||
|
||||
if ($restoreHandler) {
|
||||
restore_error_handler(); // @codeCoverageIgnore
|
||||
}
|
||||
parent::restoreStateAfterSave();
|
||||
}
|
||||
|
||||
protected static int $temporaryVersionCheck = 80500;
|
||||
|
||||
/**
|
||||
* Temporary handler for Php8.5 waiting for Dompdf release.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function specialErrorHandler(int $errno, string $errstr, string $filename, int $lineno): bool
|
||||
{
|
||||
if ($errno === E_DEPRECATED) {
|
||||
if (preg_match('/canonical|imagedestroy|http_get_last_response_headers|Using null as an array offset/', $errstr) === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false; // continue error handling
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user