aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2013-12-07 19:27:18 -0500
committerSteve Clay <steve@mrclay.org>2013-12-07 19:34:54 -0500
commit63db31c0237d24247b3b75b8365d610be936c283 (patch)
treea9bdc1dcb859ddf74b79ab594b39c41821f7e1dc /engine
parent47f209929b1913a73b8051d35d5545d28a37dba7 (diff)
downloadelgg-63db31c0237d24247b3b75b8365d610be936c283.tar.gz
elgg-63db31c0237d24247b3b75b8365d610be936c283.tar.bz2
Handle case if get_user_notification_settings() returns false
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/notification.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/engine/lib/notification.php b/engine/lib/notification.php
index b6399b3c6..2506867d5 100644
--- a/engine/lib/notification.php
+++ b/engine/lib/notification.php
@@ -110,12 +110,15 @@ function notify_user($to, $from, $subject, $message, array $params = NULL, $meth
// Are we overriding delivery?
$methods = $methods_override;
if (!$methods) {
- $tmp = (array)get_user_notification_settings($guid);
+ $tmp = get_user_notification_settings($guid);
$methods = array();
- foreach ($tmp as $k => $v) {
- // Add method if method is turned on for user!
- if ($v) {
- $methods[] = $k;
+ // $tmp may be false. don't cast
+ if (is_array($tmp)) {
+ foreach ($tmp as $k => $v) {
+ // Add method if method is turned on for user!
+ if ($v) {
+ $methods[] = $k;
+ }
}
}
}