MDL-59780 mathjax: Make sure mathjax url doesn't become empty
This commit is contained in:
@@ -138,7 +138,8 @@ MathJax.Hub.Config({
|
||||
// setting. Since it is preferably to always load the secure resource.
|
||||
|
||||
$httpurl = get_config('filter_mathjaxloader', 'httpurl');
|
||||
if ($httpurl !== 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js') {
|
||||
if ($httpurl !== 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js' &&
|
||||
$httpurl !== 'http://cdn.mathjax.org/mathjax/2.6.1/MathJax.js') {
|
||||
// If the http setting has been changed, we make the admin choose the https setting because
|
||||
// it indicates some sort of custom setup. This will be supported by the release notes.
|
||||
unset_config('httpsurl', 'filter_mathjaxloader');
|
||||
@@ -196,5 +197,15 @@ MathJax.Hub.Config({
|
||||
upgrade_plugin_savepoint(true, 2016120502, 'filter', 'mathjaxloader');
|
||||
}
|
||||
|
||||
if ($oldversion < 2016120503) {
|
||||
|
||||
$httpsurl = get_config('filter_mathjaxloader', 'httpsurl');
|
||||
if (empty($httpsurl)) {
|
||||
// URL is empty, most likely because of bad upgrade path. See MDL-59780.
|
||||
set_config('httpsurl', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js', 'filter_mathjaxloader');
|
||||
}
|
||||
upgrade_plugin_savepoint(true, 2016120503, 'filter', 'mathjaxloader');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2016120502;
|
||||
$plugin->version = 2016120503;
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component= 'filter_mathjaxloader';
|
||||
|
||||
Reference in New Issue
Block a user