update lock clucknut
All checks were successful
All checks were successful
This commit is contained in:
35
vendor/setasign/fpdi/src/FpdiTrait.php
vendored
35
vendor/setasign/fpdi/src/FpdiTrait.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user