MDL-82745 filter_tex: Improve filter deny list

This commit is contained in:
Michael Hawkins
2024-08-08 11:40:11 +07:00
committed by Huong Nguyen
parent 6728d1ccc0
commit bdfa441f00
+2 -1
View File
@@ -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