[ticket/9837] Display unapproved posts to their authors

Re-order code for efficiency

PHPBB3-9837
This commit is contained in:
v12mike 2019-10-06 09:43:45 -04:00 committed by Marc Alexander
parent 63ebd658a9
commit 15da5b108e
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -146,13 +146,12 @@ class content_visibility
{ {
$visibility = $data[$mode . '_visibility']; $visibility = $data[$mode . '_visibility'];
$poster_key = ($mode === 'topic') ? 'topic_poster' : 'poster_id'; $poster_key = ($mode === 'topic') ? 'topic_poster' : 'poster_id';
$is_visible = $this->auth->acl_get('m_approve', $forum_id) || $is_visible = ($visibility == ITEM_APPROVED) ||
($visibility == ITEM_APPROVED) || ($this->config['display_unapproved_posts'] &&
($this->config['display_unapproved_posts'] &&
($this->user->data['user_id'] <> ANONYMOUS) && ($this->user->data['user_id'] <> ANONYMOUS) &&
($visibility == ITEM_UNAPPROVED || $visibility == ITEM_REAPPROVE) && ($visibility == ITEM_UNAPPROVED || $visibility == ITEM_REAPPROVE) &&
($this->user->data['user_id'] === $data[$poster_key]) ($this->user->data['user_id'] === $data[$poster_key])) ||
); $this->auth->acl_get('m_approve', $forum_id);
/** /**
* Allow changing the result of calling is_visible * Allow changing the result of calling is_visible