aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Lyons <ejlyons@ix.netcom.com>2013-12-02 06:34:08 -0500
committerEd Lyons <ejlyons@ix.netcom.com>2013-12-02 06:34:08 -0500
commitbeab3edd8f0b821b7e90e288add261342505321f (patch)
tree61e776d426fd6b5a2dc1300695c6e2216027da54
parent47f209929b1913a73b8051d35d5545d28a37dba7 (diff)
downloadelgg-beab3edd8f0b821b7e90e288add261342505321f.tar.gz
elgg-beab3edd8f0b821b7e90e288add261342505321f.tar.bz2
Fix #6238 Return blank arrays
I committed this simple change to return the empty array rather than false for empty settings result for ElggPlugin::getAllSettings and getAllUsersSettings. Put this into 1.8 branch.
-rw-r--r--engine/classes/ElggPlugin.php21
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;
}
/**