From e596d0b6cef2a59aedaf9f20cdbf3d5f1ab46a9b Mon Sep 17 00:00:00 2001 From: brunoais Date: Sat, 29 Nov 2014 11:27:57 +0000 Subject: [PATCH] [ticket/13147] Adding $approve_forums to the list of the event's variables PHPBB3-13147 --- phpBB/phpbb/content_visibility.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php index 66cd7a8c86..dcf32f8f58 100644 --- a/phpBB/phpbb/content_visibility.php +++ b/phpBB/phpbb/content_visibility.php @@ -158,6 +158,8 @@ class content_visibility { $where_sql = '('; + $approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true))); + $content_replaced = false; /** * Allow changing the result of calling get_forums_visibility_sql @@ -167,6 +169,7 @@ class content_visibility * @var string mode Either "topic" or "post" depending on the query this is being used in * @var array forum_ids Array of forum ids which the posts/topics are limited to * @var string table_alias Table alias to prefix in SQL queries + * @var array approve_forums Array of forums where the user has m_approve permissions * @var bool content_replaced Forces the function to return where_sql after executing the event * @since 3.1.3-RC1 */ @@ -175,6 +178,7 @@ class content_visibility 'mode', 'forum_ids', 'table_alias', + 'approve_forums', 'content_replaced', ); extract($phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_forums_visibility_before', compact($vars))); @@ -184,8 +188,6 @@ class content_visibility return $content_replaced; } - $approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true))); - if (sizeof($approve_forums)) { // Remove moderator forums from the rest