]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18893 TeX filter - fine tune "def" commands + add some more commands to blacklist...
authorstronk7 <stronk7>
Mon, 20 Apr 2009 21:25:45 +0000 (21:25 +0000)
committerstronk7 <stronk7>
Mon, 20 Apr 2009 21:25:45 +0000 (21:25 +0000)
Thanks to Mauno Korpelainen and Steve Mayer. Merged from 19_STABLE

filter/tex/lib.php

index 8cec92badca7f3a342f87ca32479cd1ca044e4b3..d8c67513c10f4e7dcb54721c8cfe4bdc098ff195 100644 (file)
@@ -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);