From 3c505247130554f616de4699ce3d3a6073c2d709 Mon Sep 17 00:00:00 2001 From: Etienne Stalmans Date: Mon, 23 Oct 2017 14:40:57 +0200 Subject: [PATCH] Adds an additional check to detect if DDE links exist inside fldSimple values --- oletools/msodde.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/oletools/msodde.py b/oletools/msodde.py index c5d752e..80f9443 100644 --- a/oletools/msodde.py +++ b/oletools/msodde.py @@ -80,7 +80,7 @@ NS_WORD = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main' # XML tag for 'w:instrText' TAG_W_INSTRTEXT = '{%s}instrText' % NS_WORD - +TAG_W_FLDSIMPLE = '{%s}fldSimple' % NS_WORD # === FUNCTIONS ============================================================== @@ -111,6 +111,13 @@ def process_file(filepath): # concatenate the text of the field, if present: if elem.text is not None: text += elem.text + + for elem in root.iter(TAG_W_FLDSIMPLE): + # concatenate the attribute of the field, if present: + if elem.attrib is not None: + text += elem.attrib['{http://schemas.openxmlformats.org/wordprocessingml/2006/main}instr'] + + return text -- libgit2 0.21.4