]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Profile::current() suits better here.
authorRoland Haeder <roland@mxchange.org>
Fri, 27 Mar 2015 22:00:21 +0000 (23:00 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 29 Mar 2020 22:21:01 +0000 (00:21 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
classes/Notice.php

index 453de30ffeb71e1adc4eaed865a8ed2916fb25bc..f53563d48acedca59066846411d522b81b82ca66 100644 (file)
@@ -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:
              *