MDL-13766, trim api_key

This commit is contained in:
dongsheng 2008-08-30 16:48:11 +00:00
parent 31ca68c4c3
commit 70d91d90ab
2 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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;