mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
MDL-13766, trim api_key
This commit is contained in:
parent
31ca68c4c3
commit
70d91d90ab
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user