mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-18893 TeX filter - fine tune "def" commands + add some more commands to blacklist (from Kopete).
Thanks to Mauno Korpelainen and Steve Mayer. Merged from 19_STABLE
This commit is contained in:
parent
8b6f8099ea
commit
f6a5c4b0a7
1 changed files with 5 additions and 2 deletions
|
@ -37,12 +37,15 @@ function tex_filter_get_executable($debug=false) {
|
||||||
function tex_sanitize_formula($texexp) {
|
function tex_sanitize_formula($texexp) {
|
||||||
/// Check $texexp against blacklist (whitelisting could be more complete but also harder to maintain)
|
/// Check $texexp against blacklist (whitelisting could be more complete but also harder to maintain)
|
||||||
$tex_blacklist = array(
|
$tex_blacklist = array(
|
||||||
'include','def','command','loop','repeat','open','toks','output',
|
'include','command','loop','repeat','open','toks','output',
|
||||||
'input','catcode','name','^^',
|
'input','catcode','name','^^',
|
||||||
|
'\def','\edef','\gdef','\xdef',
|
||||||
'\every','\errhelp','\errorstopmode','\scrollmode','\nonstopmode',
|
'\every','\errhelp','\errorstopmode','\scrollmode','\nonstopmode',
|
||||||
'\batchmode','\read','\write','csname','\newhelp','\uppercase',
|
'\batchmode','\read','\write','csname','\newhelp','\uppercase',
|
||||||
'\lowercase','\relax','\aftergroup',
|
'\lowercase','\relax','\aftergroup',
|
||||||
'\afterassignment','\expandafter','\noexpand','\special'
|
'\afterassignment','\expandafter','\noexpand','\special',
|
||||||
|
'\let', '\futurelet','\else','\fi','\chardef','\makeatletter','\afterground',
|
||||||
|
'\noexpand','\line','\mathcode','\item','\section','\mbox','\declarerobustcommand'
|
||||||
);
|
);
|
||||||
|
|
||||||
return str_ireplace($tex_blacklist, 'forbiddenkeyword', $texexp);
|
return str_ireplace($tex_blacklist, 'forbiddenkeyword', $texexp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue