Skip to content

Commit

Permalink
MDL-18893 TeX filter - fine tune "def" commands + add some more comma…
Browse files Browse the repository at this point in the history
…nds to blacklist (from Kopete).

Thanks to Mauno Korpelainen and Steve Mayer. Merged from 19_STABLE
  • Loading branch information
stronk7 committed Apr 20, 2009
1 parent 8b6f809 commit f6a5c4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions filter/tex/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ function tex_filter_get_executable($debug=false) {
function tex_sanitize_formula($texexp) {
/// Check $texexp against blacklist (whitelisting could be more complete but also harder to maintain)
$tex_blacklist = array(
'include','def','command','loop','repeat','open','toks','output',
'include','command','loop','repeat','open','toks','output',
'input','catcode','name','^^',
'\def','\edef','\gdef','\xdef',
'\every','\errhelp','\errorstopmode','\scrollmode','\nonstopmode',
'\batchmode','\read','\write','csname','\newhelp','\uppercase',
'\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);
Expand Down

0 comments on commit f6a5c4b

Please sign in to comment.