Commit 54722612 authored by Sophie Brun's avatar Sophie Brun

New upstream version 0.4.2

parent 9075d711
Metadata-Version: 1.0
Name: peepdf
Version: 0.4.1
Version: 0.4.2
Summary: UNKNOWN
Home-page: http://eternal-todo.com
Author: Jose Miguel Esparza
......
Metadata-Version: 1.0
Name: peepdf
Version: 0.4.1
Version: 0.4.2
Summary: UNKNOWN
Home-page: http://eternal-todo.com
Author: Jose Miguel Esparza
......
......@@ -3,7 +3,7 @@
# http://peepdf.eternal-todo.com
# By Jose Miguel Esparza <jesparza AT eternal-todo.com>
#
# Copyright (C) 2011-2017 Jose Miguel Esparza
# Copyright (C) 2011-2018 Jose Miguel Esparza
#
# This file is part of peepdf.
#
......@@ -196,6 +196,9 @@ def isJavascript(content):
length = len(content)
smallScriptLength = 100
if content.startswith("/GS1 gs"):
return False
if re.findall(reJSscript, content, re.DOTALL | re.IGNORECASE):
return True
......
......@@ -3,7 +3,7 @@
# http://peepdf.eternal-todo.com
# By Jose Miguel Esparza <jesparza AT eternal-todo.com>
#
# Copyright (C) 2011-2017 Jose Miguel Esparza
# Copyright (C) 2011-2018 Jose Miguel Esparza
#
# This file is part of peepdf.
#
......@@ -42,9 +42,7 @@ from peepdf.PDFCrypto import (
RC4, computeObjectKey, computeUserPass, isUserPass, isOwnerPass,
computeEncryptionKey, computeOwnerPass
)
from peepdf.JSAnalysis import (
isJavascript, analyseJS
)
from peepdf.JSAnalysis import isJavascript, analyseJS
from peepdf.PDFFilters import decodeStream, encodeStream
MAL_ALL = 1
......@@ -4322,7 +4320,7 @@ class PDFBody:
self.setObject(compressedId, compressedObject, offset)
del(compressedObjectsDict)
for id in self.referencedJSObjects:
if id not in self.containingJS:
if id not in self.containingJS and id in self.objects:
object = self.objects[id].getObject()
if object is None:
errorMessage = 'Object is None'
......
......@@ -2,7 +2,7 @@ from setuptools import setup
setup(
name="peepdf",
version="0.4.1",
version="0.4.2",
author="Jose Miguel Esparza",
license="GNU GPLv3",
url="http://eternal-todo.com",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment