From d461ee4f5ca84471070f2b2a45762a179e26007e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 7 Mar 2016 21:59:40 +0100 Subject: [PATCH 1/2] [ticket/13264] Do not force approved state if post visibility is known Post visibility is used if it is set to a valid value. PHPBB3-13264 --- phpBB/includes/functions_posting.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index fae8e659bb..3e93535856 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1636,6 +1636,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u break; } } + else if (isset($data['post_visibility']) && $data['post_visibility'] !== false) + { + $post_visibility = $data['post_visibility']; + } // MODs/Extensions are able to force any visibility on posts if (isset($data['force_approved_state'])) From dd115d189658974a8a6caef532c273c90f3c2ede Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 8 Mar 2016 15:25:45 +0100 Subject: [PATCH 2/2] [ticket/13264] Link to post if user can view it PHPBB3-13264 --- phpBB/includes/functions_posting.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 3e93535856..b2713fef07 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2433,7 +2433,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $params = $add_anchor = ''; - if ($post_visibility == ITEM_APPROVED) + if ($post_visibility == ITEM_APPROVED || + ($auth->acl_get('m_softdelete', $data['forum_id']) && $post_visibility == ITEM_DELETED) || + ($auth->acl_get('m_approve', $data['forum_id']) && in_array($post_visibility, array(ITEM_UNAPPROVED, ITEM_REAPPROVE)))) { $params .= '&t=' . $data['topic_id'];