Skip to content

Commit

Permalink
MDL-82745 filter_tex: Improve filter deny list
Browse files Browse the repository at this point in the history
  • Loading branch information
mickhawkins authored and HuongNV13 committed Aug 8, 2024
1 parent 622ee09 commit a740082
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion filter/tex/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -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
Expand Down

0 comments on commit a740082

Please sign in to comment.