]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-19180, repository url plugin, fixed undefined index"
authordongsheng <dongsheng>
Fri, 29 May 2009 09:18:55 +0000 (09:18 +0000)
committerdongsheng <dongsheng>
Fri, 29 May 2009 09:18:55 +0000 (09:18 +0000)
repository/url/repository.class.php

index 7df80e0728d1d8482232b86eda07aa5e0074c69d..666974cef15fb42a984f26c1a7874380d6e09685 100755 (executable)
@@ -21,7 +21,9 @@ class repository_url extends repository {
     public function __construct($repositoryid, $context = SITEID, $options = array()){
         global $SESSION, $action, $CFG;
         parent::__construct($repositoryid, $context, $options);
-        $this->client_id = $options['client_id'];
+        if (!empty($options['client_id'])) {
+            $this->client_id = $options['client_id'];
+        }
         $this->file_url = optional_param('download_from', '', PARAM_RAW);
     }
 
@@ -31,7 +33,6 @@ class repository_url extends repository {
         $fp = fopen($path, 'w');
         $c = new curl;
         $c->download(array(array('url'=>$url, 'file'=>$fp)));
-
         return $path;
     }