mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-14 12:06:40 +00:00
Update to Php8.5-compatible Dompdf r222 (#4660)
This commit is contained in:
Generated
+7
-7
@@ -788,16 +788,16 @@
|
||||
},
|
||||
{
|
||||
"name": "dompdf/dompdf",
|
||||
"version": "v3.0.1",
|
||||
"version": "v3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dompdf/dompdf.git",
|
||||
"reference": "2d622faf9aa1f8f7f24dd094e49b5cf6c0c5d4e6"
|
||||
"reference": "794ec856134a73d2a69a474c5d4faa47e1e645b1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/2d622faf9aa1f8f7f24dd094e49b5cf6c0c5d4e6",
|
||||
"reference": "2d622faf9aa1f8f7f24dd094e49b5cf6c0c5d4e6",
|
||||
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/794ec856134a73d2a69a474c5d4faa47e1e645b1",
|
||||
"reference": "794ec856134a73d2a69a474c5d4faa47e1e645b1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -813,7 +813,7 @@
|
||||
"ext-json": "*",
|
||||
"ext-zip": "*",
|
||||
"mockery/mockery": "^1.3",
|
||||
"phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10",
|
||||
"phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"symfony/process": "^4.4 || ^5.4 || ^6.2 || ^7.0"
|
||||
},
|
||||
@@ -846,9 +846,9 @@
|
||||
"homepage": "https://github.com/dompdf/dompdf",
|
||||
"support": {
|
||||
"issues": "https://github.com/dompdf/dompdf/issues",
|
||||
"source": "https://github.com/dompdf/dompdf/tree/v3.0.1"
|
||||
"source": "https://github.com/dompdf/dompdf/tree/v3.1.1"
|
||||
},
|
||||
"time": "2024-12-05T14:59:38+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