From 350d4f3e6d8a5e4e2910a046f0097b74d51861ef Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 11 Jan 2018 21:00:19 +0100 Subject: [ticket/15506] Assign attachrow_template_vars before foreach The attachrow_template_vars array needs to be defined once in front of the foreach instead of resetting the array on every iteration of the foreach. PHPBB3-15506 --- phpBB/includes/functions_posting.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_posting.php') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 21f31c9fa2..78c66ac6b8 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -727,10 +727,11 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a // We display the posted attachments within the desired order. ($config['display_order']) ? krsort($attachment_data) : ksort($attachment_data); + $attachrow_template_vars = []; + foreach ($attachment_data as $count => $attach_row) { $hidden = ''; - $attachrow_template_vars = array(); $attach_row['real_filename'] = utf8_basename($attach_row['real_filename']); foreach ($attach_row as $key => $value) -- cgit v1.2.1