]> git.mjollnir.org Git - moodle.git/commitdiff
filters: MDL-7336 fix upgrade problem when filterall is on. Thanks Nico for finding.
authortjhunt <tjhunt>
Thu, 16 Apr 2009 09:13:30 +0000 (09:13 +0000)
committertjhunt <tjhunt>
Thu, 16 Apr 2009 09:13:30 +0000 (09:13 +0000)
lib/weblib.php

index d94903f12a48327eb35d39871cdfa74a8d4a0165..81cd07afc38c26be558b3e658645112bebaa721d 100644 (file)
@@ -1473,7 +1473,7 @@ function format_string($string, $striplinks=true, $courseid=NULL ) {
     // First replace all ampersands not followed by html entity code
     $string = preg_replace("/\&(?![a-zA-Z0-9#]{1,8};)/", "&amp;", $string);
 
-    if (!empty($CFG->filterall)) {
+    if (!empty($CFG->filterall) && $CFG->version >= 2009040600) { // Avoid errors during the upgrade to the new system.
         $context = get_context_instance(CONTEXT_SYSTEM); // TODO change, once we have $PAGE->context.
         $string = filter_manager::instance()->filter_string($string, $context, $courseid);
     }