mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-01-07 20:51:20 +00:00
Don't open encrypted files, even if password is empty
This commit is contained in:
parent
2cb75f6076
commit
0ebbd4e21b
@ -30,6 +30,7 @@ import pikepdf
|
||||
from . import ghosttext
|
||||
from .layout import get_page_analysis, get_text_boxes
|
||||
|
||||
from ..exceptions import EncryptedPdfError
|
||||
from ..helpers import fspath
|
||||
|
||||
|
||||
@ -593,6 +594,8 @@ def _pdf_get_all_pageinfo(infile, detailed_analysis=False, log=None):
|
||||
log = Mock()
|
||||
|
||||
pdf = pikepdf.open(infile)
|
||||
if pdf.is_encrypted:
|
||||
raise EncryptedPdfError() # Triggered by encryption with empty passwd
|
||||
if detailed_analysis:
|
||||
pages_xml = None
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user