From 17e2095facd4c0e02eed6e731a9c4ccbf1a4a15b Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 27 Mar 2015 23:00:21 +0100 Subject: [PATCH 1/1] 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 02b8ce3549..9f0575228d 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -2506,16 +2506,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.2