diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 22b15cd893..d3eb61b3e4 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -815,13 +815,12 @@ function posting_gen_inline_attachments(&$attachment_data) /** * Generate inline attachment entry */ -function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_attach_box = true) +function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_attach_box = true, $forum_id = false) { - global $template, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher; - global $cache, $request; + global $template, $cache, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher; // $forum_id when FALSE check for PMs if INT then check for forum id (topics|posts) - $forum_id = $request->variable('f', 0) ?: false; + $forum_id != false ?: (int) $forum_id; $allowed_attachments = array_keys($cache->obtain_attach_extensions($forum_id)['_allowed_']); // Some default template variables diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 7cb4c85916..0dae644488 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1390,7 +1390,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) } // Attachment entry - posting_gen_attachment_entry($attachment_data, $filename_data, $allowed); + posting_gen_attachment_entry($attachment_data, $filename_data, $allowed, false); // Message History if ($action == 'reply' || $action == 'quote' || $action == 'forward') diff --git a/phpBB/posting.php b/phpBB/posting.php index 6fc56abdd9..bc3e28ca43 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -2078,7 +2078,7 @@ if ($allowed) } // Attachment entry -posting_gen_attachment_entry($attachment_data, $filename_data, $allowed); +posting_gen_attachment_entry($attachment_data, $filename_data, $allowed, $forum_id); // Output page ... page_header($page_title);