From ca96f2eee99ed4fe597dddb7af71eade5a0afaeb Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 27 Mar 2015 23:00:21 +0100 Subject: [PATCH] Profile::current() suits better here. Signed-off-by: Roland Haeder --- classes/Notice.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 453de30ffe..f53563d48a 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -2691,16 +2691,12 @@ class Notice extends Managed_DataObject // Check default scope (non-private notices) $inScope = (!$this->isPrivateScope()); - // Get current user - $user = common_current_user(); + // Get current profile + $profile = Profile::current(); // Is the general scope check okay and the user in logged in? - /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: inScope=' . intval($inScope) . ',user[]=' . gettype($user)); - if (($inScope === TRUE) && ($user instanceof User)) { - // Get profile from it - $profile = $user->getProfile(); - /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: inScope=' . intval($inScope) . ',profile[]=' . gettype($profile)); - + /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: inScope=' . intval($inScope) . ',profile[]=' . gettype($profile)); + if (($inScope === TRUE) && ($profile instanceof Profile)) { /* * Check scope, else a privacy leaks happens this way: * -- 2.39.5