MDL-23568 PAGE->context is a pain in the ...
This commit is contained in:
+7
-2
@@ -975,7 +975,12 @@ function format_text($text, $format = FORMAT_MOODLE, $options = NULL, $courseid_
|
||||
}
|
||||
|
||||
// Calculate best context
|
||||
if (isset($options['context'])) { // first by explicit passed context option
|
||||
if (empty($CFG->version) or $CFG->version < 2010072800 or during_initial_install()) {
|
||||
// do not filter anything during installation or before upgrade completes
|
||||
$context = null;
|
||||
$options['nocache'] = true;
|
||||
|
||||
} else if (isset($options['context'])) { // first by explicit passed context option
|
||||
if (is_object($options['context'])) {
|
||||
$context = $options['context'];
|
||||
} else {
|
||||
@@ -1190,7 +1195,7 @@ function format_string($string, $striplinks = true, $options = NULL) {
|
||||
//We'll use a in-memory cache here to speed up repeated strings
|
||||
static $strcache = false;
|
||||
|
||||
if (empty($CFG->version) or $CFG->version < 2010072800) {
|
||||
if (empty($CFG->version) or $CFG->version < 2010072800 or during_initial_install()) {
|
||||
// do not filter anything during installation or before upgrade completes
|
||||
return $string = strip_tags($string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user