diff options
author | Steve Clay <steve@mrclay.org> | 2013-12-07 17:01:03 -0800 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2013-12-07 17:01:03 -0800 |
commit | 752f946f8de8660972075d6bcfe18181a450a216 (patch) | |
tree | 5f02740ead2b28bd176331bf0ec0447a4cacfa64 | |
parent | 63db31c0237d24247b3b75b8365d610be936c283 (diff) | |
parent | beab3edd8f0b821b7e90e288add261342505321f (diff) | |
download | elgg-752f946f8de8660972075d6bcfe18181a450a216.tar.gz elgg-752f946f8de8660972075d6bcfe18181a450a216.tar.bz2 |
Merge pull request #6250 from edfactor/patch-1
Makes sure plugin settings functions return arrays
-rw-r--r-- | engine/classes/ElggPlugin.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php index 7bf6eb1df..81831d8cd 100644 --- a/engine/classes/ElggPlugin.php +++ b/engine/classes/ElggPlugin.php @@ -299,17 +299,16 @@ class ElggPlugin extends ElggObject { $private_settings = get_data($q); + $return = array(); + if ($private_settings) { - $return = array(); - + foreach ($private_settings as $setting) { $return[$setting->name] = $setting->value; } + } - return $return; - } - - return false; + return $return; } /** @@ -423,9 +422,10 @@ class ElggPlugin extends ElggObject { $private_settings = get_data($q); - if ($private_settings) { - $return = array(); - + $return = array(); + + if ($private_settings) { + foreach ($private_settings as $setting) { $name = substr($setting->name, $ps_prefix_len); $value = $setting->value; @@ -433,10 +433,9 @@ class ElggPlugin extends ElggObject { $return[$name] = $value; } - return $return; } - return false; + return $return; } /** |