From: tjhunt Date: Mon, 13 Apr 2009 06:55:21 +0000 (+0000) Subject: filters: MDL-7336 Set ->stringfilters on upgrade X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bbb459050e831ccd45fbad704449b59a895143e7;p=moodle.git filters: MDL-7336 Set ->stringfilters on upgrade --- diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index c7cc88996d..a9bd56ddeb 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1623,6 +1623,23 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL"); upgrade_main_savepoint($result, 2009040302); } + if ($result && $oldversion < 2009040600) { + /// Ensure that $CFG->stringfilters is set. + if (empty($CFG->stringfilters)) { + if (!empty($CFG->filterall)) { + set_config('stringfilters', $CFG->textfilters); + } else { + set_config('stringfilters', ''); + } + } + + set_config('filterall', !empty($CFG->stringfilters)); + unset_config('textfilters'); + + /// Main savepoint reached + upgrade_main_savepoint($result, 2009040600); + } + return $result; } diff --git a/version.php b/version.php index 910d18e47a..d5f048d4a6 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2009040303; // YYYYMMDD = date of the last version bump + $version = 2009040600; // YYYYMMDD = date of the last version bump // XX = daily increments $release = '2.0 dev (Build: 20090413)'; // Human-friendly version name