From bdfa441f007f5829f3fffae37756e5124aa1a0b4 Mon Sep 17 00:00:00 2001 From: Michael Hawkins Date: Thu, 8 Aug 2024 11:13:40 +0800 Subject: [PATCH] MDL-82745 filter_tex: Improve filter deny list --- filter/tex/lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filter/tex/lib.php b/filter/tex/lib.php index 5c4d4af2ff4..884f4d3ef87 100644 --- a/filter/tex/lib.php +++ b/filter/tex/lib.php @@ -84,7 +84,7 @@ function filter_tex_sanitize_formula(string $texexp): string { '\afterassignment', '\expandafter', '\noexpand', '\special', '\let', '\futurelet', '\else', '\fi', '\chardef', '\makeatletter', '\afterground', '\noexpand', '\line', '\mathcode', '\item', '\section', '\mbox', '\declarerobustcommand', - '\ExplSyntaxOn', + '\ExplSyntaxOn', '\pdffiledump', ]; $allowlist = ['inputenc']; @@ -102,6 +102,7 @@ function filter_tex_sanitize_formula(string $texexp): string { // First, mangle all denied words. $texexp = preg_replace_callback($denylist, function($matches) { + error_log("FORBIDDEN: " . $matches[0]); return 'forbiddenkeyword_' . $matches[0]; }, $texexp