aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/notification.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/notification.php')
-rw-r--r--engine/lib/notification.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/engine/lib/notification.php b/engine/lib/notification.php
index 8eeb009c0..7f7238daa 100644
--- a/engine/lib/notification.php
+++ b/engine/lib/notification.php
@@ -137,8 +137,7 @@
{
$user_guid = (int)$user_guid;
- if ($user_guid == 0)
- $user_guid = $_SESSION['user']->guid;
+ if ($user_guid == 0) $user_guid = get_loggedin_userid();
$all_metadata = get_metadata_for_entity($user_guid);
if ($all_metadata)
@@ -173,11 +172,9 @@
{
$user_guid = (int)$user_guid;
$method = sanitise_string($method);
-
- if ($user_guid == 0)
- $user_guid = $_SESSION['user']->guid;
$user = get_entity($user_guid);
+ if (!$user) $user = get_loggedin_user();
if (($user) && ($user instanceof ElggUser))
{