MDL-82745 filter_tex: Improve filter deny list

This commit is contained in:
Michael Hawkins 2024-08-08 11:13:40 +08:00 committed by Huong Nguyen
parent 622ee09209
commit a74008207a
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A

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