mirror of
https://github.com/moodle/moodle.git
synced 2025-02-21 09:52:54 +01:00
MDL-82745 filter_tex: Improve filter deny list
This commit is contained in:
parent
622ee09209
commit
a74008207a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user