Skip to content

Commit

Permalink
MDL-35238 Accept $CFG->alternativeupdateproviderurl from config.php f…
Browse files Browse the repository at this point in the history
…ile 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.
  • Loading branch information
mudrd8mz committed Nov 8, 2012
1 parent dc11af1 commit 56c0508
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pluginlib.php
Expand Up @@ -987,8 +987,8 @@ protected function compare_responses(array $old, array $new) {
protected function prepare_request_url() { protected function prepare_request_url() {
global $CFG; global $CFG;


if (!empty($CFG->alternativeupdateproviderurl)) { if (!empty($CFG->config_php_settings['alternativeupdateproviderurl'])) {
return $CFG->alternativeupdateproviderurl; return $CFG->config_php_settings['alternativeupdateproviderurl'];
} else { } else {
return 'http://download.moodle.org/api/1.1/updates.php'; return 'http://download.moodle.org/api/1.1/updates.php';
} }
Expand Down

0 comments on commit 56c0508

Please sign in to comment.