From 773c513ac0a0d3b580462a5eec2f65782f26b3c3 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Tue, 7 Aug 2012 16:59:57 +0100 Subject: [PATCH] [feature/attach-dl] Moved include of compress class inside function PHPBB3-11042 --- phpBB/includes/functions_display.php | 5 +++++ phpBB/viewtopic.php | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 6164885732..1f541a7733 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1298,6 +1298,11 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $ */ function phpbb_gen_download_links($param_key, $param_val, $phpbb_root_path, $phpEx) { + if (!class_exists('compress')) + { + require $phpbb_root_path . 'includes/functions_compress.' . $phpEx; + } + $methods = compress::methods(); $links = array(); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index a65944742e..9f044e0a89 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1318,7 +1318,6 @@ $template->assign_vars(array( 'S_HAS_ATTACHMENTS' => !empty($attachments), )); -require_once $phpbb_root_path . 'includes/functions_compress.' . $phpEx; $methods = phpbb_gen_download_links('topic_id', $topic_id, $phpbb_root_path, $phpEx); foreach ($methods as $method) {