Permalink
Browse files

MDL-33749 follow redirects for URL downloader

  • Loading branch information...
kwiliarty committed Jun 19, 2012
1 parent ec7a8c3 commit 78dd6d4813baab8b170c8d17fe4190d6a7a8f3c8
Showing with 1 addition and 0 deletions.
  1. +1 −0 repository/url/lib.php
View
@@ -98,6 +98,7 @@ public function get_listing($path='', $page='') {
global $CFG, $OUTPUT;
$ret = array();
$curl = new curl;
+ $curl->setopt(array('CURLOPT_FOLLOWLOCATION' => true, 'CURLOPT_MAXREDIRS' => 3));
$msg = $curl->head($this->file_url);
$info = $curl->get_info();
if ($info['http_code'] != 200) {

0 comments on commit 78dd6d4

Please sign in to comment.