From 99065723cbb7eb8e6db4a72f7b53e363db65e73e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 13 Sep 2021 19:17:01 +0100 Subject: [PATCH] Check svg files within themes --- tests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests.py b/tests.py index 05e096796..c72610094 100644 --- a/tests.py +++ b/tests.py @@ -3441,6 +3441,19 @@ def _testDangerousSVG() -> None: '' assert dangerousSVG(svgContent, False) + baseDir = os.getcwd() + for subdir, dirs, files in os.walk(baseDir + '/theme'): + for f in files: + if not f.endswith('.svg'): + continue + svgFilename = os.path.join(subdir, f) + print(svgFilename) + content = '' + with open(svgFilename, 'r') as fp: + content = fp.read() + assert not dangerousCSS(content, False) + # deliberately no break - should resursively scan + def _testDangerousMarkup(): print('testDangerousMarkup')