update lock clucknut
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / build-and-push (push) Successful in 3m14s
Build, Push and Deploy / deploy-staging (push) Successful in 25s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-18 20:32:18 +07:00
parent 4554035227
commit dcaf267458
3359 changed files with 153185 additions and 205489 deletions

View File

@@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/
@@ -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)) {
@@ -166,7 +172,8 @@ protected function getPdfReaderId($file, array $parserParams = [])
);
}
/** @noinspection OffsetOperationsInspection */
$id = \md5($id . '|' . \print_r($parserParams, true));
if (isset($this->readers[$id])) {
return $id;
}
@@ -181,7 +188,6 @@ protected function getPdfReaderId($file, array $parserParams = [])
}
$reader = new PdfReader($this->getPdfParserInstance($streamReader, $parserParams));
/** @noinspection OffsetOperationsInspection */
$this->readers[$id] = $reader;
return $id;
@@ -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] = [];
@@ -313,7 +322,7 @@ public function importPage(
$dict->value['Resources'] = $resources;
}
list($width, $height) = $page->getWidthAndHeight($box);
[$width, $height] = $page->getWidthAndHeight($box);
$a = 1;
$b = 0;
@@ -522,11 +531,11 @@ public function useImportedPage($pageId, $x = 0, $y = 0, $width = null, $height
protected function adjustLastLink($externalLink, $xPt, $scaleX, $yPt, $newHeightPt, $scaleY, $importedPage)
{
// let's create a relation of the newly created link to the data of the external link
$lastLink = count($this->PageLinks[$this->page]);
$lastLink = \count($this->PageLinks[$this->page]);
$this->PageLinks[$this->page][$lastLink - 1]['importedLink'] = $externalLink;
if (count($externalLink['quadPoints']) > 0) {
if (\count($externalLink['quadPoints']) > 0) {
$quadPoints = [];
for ($i = 0, $n = count($externalLink['quadPoints']); $i < $n; $i += 2) {
for ($i = 0, $n = \count($externalLink['quadPoints']); $i < $n; $i += 2) {
$quadPoints[] = $xPt + $externalLink['quadPoints'][$i] * $scaleX;
$quadPoints[] = $this->hPt - $yPt - $newHeightPt + $externalLink['quadPoints'][$i + 1] * $scaleY;
}