MDL-32279 filters: filters: setup() before filter() is better.
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 15 Jun 2012 08:12:53 +0000 (10:12 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 15 Jun 2012 08:12:53 +0000 (10:12 +0200)
lib/weblib.php

index 644d48b..84362fe 100644 (file)
@@ -1303,8 +1303,8 @@ function format_string($string, $striplinks = true, $options = NULL) {
 
     if (!empty($CFG->filterall)) {
         $filtermanager = filter_manager::instance();
-        $string = $filtermanager->filter_string($string, $options['context']);
         $filtermanager->setup_page_for_filters($PAGE, $options['context']); // Setup global stuff filters may have.
+        $string = $filtermanager->filter_string($string, $options['context']);
     }
 
     // If the site requires it, strip ALL tags from this string