From 4abbc71139f8624b46a0510e347b697df01e00ab Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Tue, 23 Apr 2024 20:33:23 -0300 Subject: [PATCH] feat: Do not sign secured document Signed-off-by: Vitor Mattos --- lib/Service/PdfParserService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Service/PdfParserService.php b/lib/Service/PdfParserService.php index 497b8b27aa..91a41b03e3 100644 --- a/lib/Service/PdfParserService.php +++ b/lib/Service/PdfParserService.php @@ -59,6 +59,9 @@ public function getMetadata(File $node): array { try { $output = $this->parsePdfOnlyWithPhp($tempFile); } catch (\Throwable $th) { + if ($th->getMessage() === 'Secured pdf file are currently not supported.') { + throw new LibresignException('Secured pdf file are currently not supported.'); + } $this->logger->error('Impossible get metadata from this file: ' . $th->getMessage()); throw new LibresignException('Impossible get metadata from this file.'); }