From 14d20de162c9778945c2288384a716917c6d0cf7 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 16 Apr 2009 09:13:30 +0000 Subject: [PATCH] filters: MDL-7336 fix upgrade problem when filterall is on. Thanks Nico for finding. --- lib/weblib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.39.5