Permalink
Browse files

MDL-39664 mdeploy follows redirects now.

  • Loading branch information...
1 parent cb97a97 commit 6053036976ae6ca6817a8886ac8aa189b0018578 @nebgor nebgor committed May 14, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 mdeploy.php
View
3 mdeploy.php
@@ -1053,6 +1053,7 @@ protected function download_file($source, $target) {
curl_setopt($ch, CURLOPT_TIMEOUT, 3600);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); // nah, moodle.org is never unavailable! :-p
curl_setopt($ch, CURLOPT_URL, $source);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Allow redirection, we trust in ssl.
if ($cacertfile = $this->get_cacert()) {
// Do not use CA certs provided by the operating system. Instead,
@@ -1110,7 +1111,7 @@ protected function download_file($source, $target) {
$this->log('Curl Error.');
return false;
- } else if (is_array($this->curlinfo) && (empty($this->curlinfo['http_code']) or (($this->curlinfo['http_code'] != 200) && $this->curlinfo['http_code'] != 302))) {
+ } else if (is_array($this->curlinfo) && (empty($this->curlinfo['http_code']) or ($this->curlinfo['http_code'] != 200))) {
$this->log('Curl remote error.');
$this->log(print_r($this->curlinfo,true));
return false;

0 comments on commit 6053036

Please sign in to comment.