From c5cefe76b5baf1a9b7aa51ca352afb9e56c97f70 Mon Sep 17 00:00:00 2001 From: Jan Slabon Date: Fri, 6 Mar 2026 12:26:30 +0100 Subject: [PATCH 1/2] Added SensitiveParameter attribute to the `$parserParams` parameter in all methods handling that parameter. --- src/FpdiTrait.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/FpdiTrait.php b/src/FpdiTrait.php index 6626287..4879a05 100644 --- a/src/FpdiTrait.php +++ b/src/FpdiTrait.php @@ -127,8 +127,11 @@ protected function setMinPdfVersion($pdfVersion) * @param array $parserParams Individual parameters passed to the parser instance. * @return PdfParser|FpdiPdfParser */ - protected function getPdfParserInstance(StreamReader $streamReader, array $parserParams = []) - { + protected function getPdfParserInstance( + StreamReader $streamReader, + #[\SensitiveParameter] + array $parserParams = [] + ) { // note: if you get an exception here - turn off errors/warnings on not found classes for your autoloader. // psr-4 (https://www.php-fig.org/psr/psr-4/) says: Autoloader implementations MUST NOT throw // exceptions, MUST NOT raise errors of any level, and SHOULD NOT return a value. @@ -149,8 +152,11 @@ protected function getPdfParserInstance(StreamReader $streamReader, array $parse * @param array $parserParams Individual parameters passed to the parser instance. * @return string */ - protected function getPdfReaderId($file, array $parserParams = []) - { + protected function getPdfReaderId( + $file, + #[\SensitiveParameter] + array $parserParams = [] + ) { if (\is_resource($file)) { $id = (string) $file; } elseif (\is_string($file)) { @@ -228,8 +234,11 @@ public function setSourceFile($file) * @throws PdfParserException * @throws PdfTypeException */ - public function setSourceFileWithParserParams($file, array $parserParams = []) - { + public function setSourceFileWithParserParams( + $file, + #[\SensitiveParameter] + array $parserParams = [] + ) { $this->currentReaderId = $this->getPdfReaderId($file, $parserParams); $this->objectsToCopy[$this->currentReaderId] = []; From 1a56d76700535d0b78090941dbf4cfa28f3f6aca Mon Sep 17 00:00:00 2001 From: Jan Slabon Date: Tue, 10 Mar 2026 10:16:43 +0100 Subject: [PATCH 2/2] Optimized PHP version dependency in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d9bfca5..9caf539 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } }, "require": { - "php": "^7.2 || ^8.0", + "php": ">=7.2 <=8.5.99999", "ext-zlib": "*" }, "conflict": {