]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17738 fixed uninitialised setting
authorskodak <skodak>
Sun, 28 Dec 2008 18:42:35 +0000 (18:42 +0000)
committerskodak <skodak>
Sun, 28 Dec 2008 18:42:35 +0000 (18:42 +0000)
lib/filterlib.php

index 7227180ac2f40c3fa56365c843c94faabcc8c8b8..0fb005d6e250535d01b549ba35d99f4ed3cc41aa 100644 (file)
@@ -30,13 +30,15 @@ abstract class filter_base {
         }
 
         // back compatable with old filter plugins
-        $textfilters = explode(',', $CFG->textfilters);
-        foreach ($textfilters as $v) {
-            $text_filter = basename($v).'_filter';
-            if (empty(self::$filters[$text_filter]) && is_readable($CFG->dirroot .'/'. $v .'/filter.php')) {
-                include_once($CFG->dirroot .'/'. $v .'/filter.php');
-                if (function_exists($text_filter)) {
-                    $text = $text_filter($courseid, $text);
+        if (isset($CFG->textfilters)) {
+            $textfilters = explode(',', $CFG->textfilters);
+            foreach ($textfilters as $v) {
+                $text_filter = basename($v).'_filter';
+                if (empty(self::$filters[$text_filter]) && is_readable($CFG->dirroot .'/'. $v .'/filter.php')) {
+                    include_once($CFG->dirroot .'/'. $v .'/filter.php');
+                    if (function_exists($text_filter)) {
+                        $text = $text_filter($courseid, $text);
+                    }
                 }
             }
         }