From 2fcc1b4d188b7e2fc77baa4ddb1ee4cfe154d92a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 1 Dec 2016 08:09:21 -0800 Subject: [PATCH] [ticket/14883] Refactor forum rules logic PHPBB3-14883 --- phpBB/includes/functions_display.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 0a3c698551..34f0d518a2 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -726,6 +726,11 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod */ function generate_forum_rules(&$forum_data) { + if ($forum_data['forum_rules']) + { + $forum_data['forum_rules'] = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options']); + } + if (!$forum_data['forum_rules'] && !$forum_data['forum_rules_link']) { return; @@ -733,20 +738,10 @@ function generate_forum_rules(&$forum_data) global $template; - if ($forum_data['forum_rules']) - { - $forum_data['forum_rules'] = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options']); - } - - if (!$forum_data['forum_rules']) - { - return; - } - $template->assign_vars(array( - 'S_FORUM_RULES' => true, - 'U_FORUM_RULES' => $forum_data['forum_rules_link'], - 'FORUM_RULES' => $forum_data['forum_rules']) + 'S_FORUM_RULES' => true, + 'U_FORUM_RULES' => $forum_data['forum_rules_link'], + 'FORUM_RULES' => $forum_data['forum_rules']) ); }