MDL-35238 Accept $CFG->alternativeupdateproviderurl from config.php file only

There was a potential security risk that someone with access to the Moodle
database could update mdl_config table and use it as a vector to
install malicious code on the server.

Credit goes to Dan Poltawski for raising this.
This commit is contained in:
David Mudrák
2012-11-08 22:33:08 +01:00
parent dc11af1903
commit 56c05088e5
+2 -2
View File
@@ -987,8 +987,8 @@ class available_update_checker {
protected function prepare_request_url() {
global $CFG;
if (!empty($CFG->alternativeupdateproviderurl)) {
return $CFG->alternativeupdateproviderurl;
if (!empty($CFG->config_php_settings['alternativeupdateproviderurl'])) {
return $CFG->config_php_settings['alternativeupdateproviderurl'];
} else {
return 'http://download.moodle.org/api/1.1/updates.php';
}