From: tjhunt <tjhunt> Date: Thu, 16 Apr 2009 09:13:30 +0000 (+0000) Subject: filters: MDL-7336 fix upgrade problem when filterall is on. Thanks Nico for finding. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=14d20de162c9778945c2288384a716917c6d0cf7;p=moodle.git filters: MDL-7336 fix upgrade problem when filterall is on. Thanks Nico for finding. --- diff --git a/lib/weblib.php b/lib/weblib.php index d94903f12a..81cd07afc3 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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};)/", "&", $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); }