From: Roland Haeder Date: Fri, 27 Mar 2015 22:00:21 +0000 (+0100) Subject: Profile::current() suits better here. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=17e2095facd4c0e02eed6e731a9c4ccbf1a4a15b;p=quix0rs-gnu-social.git Profile::current() suits better here. Signed-off-by: Roland Haeder --- 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: *