From f34d72c143ebf274c47d7bf21d9d7bf8bca5942f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 14 May 2018 22:25:39 +0200 Subject: [PATCH] Fixes: - used empty() instead of x() - removed superflous count() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- include/conversation.php | 4 ++-- include/security.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index e971798c9..43f0a445d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -391,8 +391,8 @@ function visible_activity($item) { } } - /// @TODO such things are unneccessary code-complexibilities and should be avoided - if (activity_match($item['verb'], ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE && !(x($item, 'self') && ($item['uid'] == local_user()))) { + // @TODO below if() block can be rewritten to a single line: $isVisible = allConditionsHere; + if (activity_match($item['verb'], ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE && empty($item['self']) && $item['uid'] == local_user()) { return false; } diff --git a/include/security.php b/include/security.php index 5d563f324..bcfddf887 100644 --- a/include/security.php +++ b/include/security.php @@ -254,6 +254,7 @@ function can_write_wall($owner) return false; } +/// @TODO $groups should be array function permissions_sql($owner_id, $remote_verified = false, $groups = null) { $local_user = local_user(); @@ -305,7 +306,7 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null) if ($remote_verified) { $gs = '<<>>'; // should be impossible to match - if (is_array($groups) && count($groups)) { + if (is_array($groups)) { foreach ($groups as $g) { $gs .= '|<' . intval($g) . '>'; }