Skip to content

Commit fa1952f

Browse files
committed
[ticket/16071] Undefined index for custom attachments groups
PHPBB3-16071
1 parent 97e92f5 commit fa1952f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

phpBB/includes/acp/acp_attachments.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,13 +1240,17 @@ function main($id, $mode)
12401240
$display_cat = isset($extensions[$row['extension']]['display_cat']) ? $extensions[$row['extension']]['display_cat'] : ATTACHMENT_CATEGORY_NONE;
12411241
$l_downloaded_viewed = ($display_cat == ATTACHMENT_CATEGORY_NONE) ? 'DOWNLOAD_COUNTS' : 'VIEWED_COUNTS';
12421242

1243+
// Capitalises the group name and checks if its key exists in the language file
1244+
$up_group_name = utf8_strtoupper($extensions[$row['extension']]['group_name']);
1245+
$ext_group_name = (!empty($up_group_name)) ? (isset($user->lang['EXT_GROUP_' . $up_group_name]) ? $user->lang['EXT_GROUP_' . $up_group_name] : '') : '';
1246+
12431247
$template->assign_block_vars('attachments', array(
12441248
'ATTACHMENT_POSTER' => get_username_string('full', (int) $row['poster_id'], (string) $row['username'], (string) $row['user_colour'], (string) $row['username']),
12451249
'FILESIZE' => get_formatted_filesize((int) $row['filesize']),
12461250
'FILETIME' => $user->format_date((int) $row['filetime']),
12471251
'REAL_FILENAME' => (!$row['in_message']) ? utf8_basename((string) $row['real_filename']) : '',
12481252
'PHYSICAL_FILENAME' => utf8_basename((string) $row['physical_filename']),
1249-
'EXT_GROUP_NAME' => (!empty($extensions[$row['extension']]['group_name'])) ? $user->lang['EXT_GROUP_' . $extensions[$row['extension']]['group_name']] : '',
1253+
'EXT_GROUP_NAME' => $ext_group_name,
12501254
'COMMENT' => $comment,
12511255
'TOPIC_TITLE' => (!$row['in_message']) ? (string) $row['topic_title'] : '',
12521256
'ATTACH_ID' => (int) $row['attach_id'],

0 commit comments

Comments
 (0)