]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13766, trim api_key
authordongsheng <dongsheng>
Sat, 30 Aug 2008 16:48:11 +0000 (16:48 +0000)
committerdongsheng <dongsheng>
Sat, 30 Aug 2008 16:48:11 +0000 (16:48 +0000)
repository/boxnet/repository.class.php
repository/flickr/repository.class.php

index ab38a52972f2d8145ec83c028f3bc52e59e27612..e898e6ca2fc3052e440795d60c4f46c7d7a09787 100755 (executable)
@@ -15,7 +15,7 @@ class repository_boxnet extends repository{
 
     public function set_option($options = array()){
         if (!empty($options['api_key'])) {
-            set_config('api_key', $options['api_key'], 'boxnet');
+            set_config('api_key', trim($options['api_key']), 'boxnet');
         }
         unset($options['api_key']);
         $ret = parent::set_option($options);
@@ -24,9 +24,9 @@ class repository_boxnet extends repository{
 
     public function get_option($config = ''){
         if($config==='api_key'){
-            return get_config('boxnet', 'api_key');
+            return trim(get_config('boxnet', 'api_key'));
         } else {
-            $options['api_key'] = get_config('boxnet', 'api_key');
+            $options['api_key'] = trim(get_config('boxnet', 'api_key'));
         }
         $options = parent::get_option($config);
         return $options;
index 58a1f0bfd7b4be618a5999c1421c78186ca0ef85..948c662f32d025110cf5724a70be310cae54138b 100755 (executable)
@@ -16,7 +16,7 @@ class repository_flickr extends repository{
 
     public function set_option($options = array()){
         if (!empty($options['api_key'])) {
-            set_config('api_key', $options['api_key'], 'flickr');
+            set_config('api_key', trim($options['api_key']), 'flickr');
         }
         unset($options['api_key']);
         $ret = parent::set_option($options);
@@ -25,9 +25,9 @@ class repository_flickr extends repository{
 
     public function get_option($config = ''){
         if($config==='api_key'){
-            return get_config('flickr', 'api_key');
+            return trim(get_config('flickr', 'api_key'));
         } else {
-            $options['api_key'] = get_config('flickr', 'api_key');
+            $options['api_key'] = trim(get_config('flickr', 'api_key'));
         }
         $options = parent::get_option($config);
         return $options;