MDL-46811 update download.moodle.org url to https
https is now the prefferd protocol for this site
This commit is contained in:
@@ -67,14 +67,14 @@
|
||||
* To install one component:
|
||||
* <code>
|
||||
* require_once($CFG->libdir.'/componentlib.class.php');
|
||||
* if ($cd = new component_installer('http://download.moodle.org', 'langpack/2.0',
|
||||
* if ($cd = new component_installer('https://download.moodle.org', 'langpack/2.0',
|
||||
* 'es.zip', 'languages.md5', 'lang')) {
|
||||
* $status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
|
||||
* switch ($status) {
|
||||
* case COMPONENT_ERROR:
|
||||
* if ($cd->get_error() == 'remotedownloaderror') {
|
||||
* $a = new stdClass();
|
||||
* $a->url = 'http://download.moodle.org/langpack/2.0/es.zip';
|
||||
* $a->url = 'https://download.moodle.org/langpack/2.0/es.zip';
|
||||
* $a->dest= $CFG->dataroot.'/lang';
|
||||
* print_error($cd->get_error(), 'error', '', $a);
|
||||
* } else {
|
||||
@@ -225,7 +225,7 @@ class component_installer {
|
||||
return false;
|
||||
}
|
||||
/// Check for correct sourcebase (this will be out in the future)
|
||||
if (!PHPUNIT_TEST and $this->sourcebase != 'http://download.moodle.org') {
|
||||
if (!PHPUNIT_TEST and $this->sourcebase != 'https://download.moodle.org') {
|
||||
$this->errorstring='wrongsourcebase';
|
||||
return false;
|
||||
}
|
||||
@@ -674,9 +674,9 @@ class lang_installer {
|
||||
public function lang_pack_url($langcode = '') {
|
||||
|
||||
if (empty($langcode)) {
|
||||
return 'http://download.moodle.org/langpack/'.$this->version.'/';
|
||||
return 'https://download.moodle.org/langpack/'.$this->version.'/';
|
||||
} else {
|
||||
return 'http://download.moodle.org/download.php/langpack/'.$this->version.'/'.$langcode.'.zip';
|
||||
return 'https://download.moodle.org/download.php/langpack/'.$this->version.'/'.$langcode.'.zip';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,7 +686,7 @@ class lang_installer {
|
||||
* @return array|bool false if can not download
|
||||
*/
|
||||
public function get_remote_list_of_languages() {
|
||||
$source = 'http://download.moodle.org/langpack/' . $this->version . '/languages.md5';
|
||||
$source = 'https://download.moodle.org/langpack/' . $this->version . '/languages.md5';
|
||||
$availablelangs = array();
|
||||
|
||||
if ($content = download_file_content($source)) {
|
||||
@@ -778,7 +778,7 @@ class lang_installer {
|
||||
protected function install_language_pack($langcode) {
|
||||
|
||||
// initialise new component installer to process this language
|
||||
$installer = new component_installer('http://download.moodle.org', 'download.php/direct/langpack/' . $this->version,
|
||||
$installer = new component_installer('https://download.moodle.org', 'download.php/direct/langpack/' . $this->version,
|
||||
$langcode . '.zip', 'languages.md5', 'lang');
|
||||
|
||||
if (!$installer->requisitesok) {
|
||||
|
||||
Reference in New Issue
Block a user