From 15da5b108e6b93fd0059b1b523b68eccec1cce5c Mon Sep 17 00:00:00 2001
From: v12mike <github@ingenious.co.nz>
Date: Sun, 6 Oct 2019 09:43:45 -0400
Subject: [PATCH] [ticket/9837] Display unapproved posts to their authors

Re-order code for efficiency

PHPBB3-9837
---
 phpBB/phpbb/content_visibility.php | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index 276a9d9d23..bea49c0be1 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -146,13 +146,12 @@ class content_visibility
 	{
 		$visibility = $data[$mode . '_visibility'];
 		$poster_key = ($mode === 'topic') ? 'topic_poster' : 'poster_id';
-		$is_visible = $this->auth->acl_get('m_approve', $forum_id) ||
-			($visibility == ITEM_APPROVED) ||
-			($this->config['display_unapproved_posts'] &&
+		$is_visible = ($visibility == ITEM_APPROVED) ||
+            ($this->config['display_unapproved_posts'] &&
 				($this->user->data['user_id'] <> ANONYMOUS) &&
 				($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