mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/14437] Correctly assume index from attachment display order
PHPBB3-14437
This commit is contained in:
parent
6e4ab6509b
commit
c5c2f7f7d0
1 changed files with 2 additions and 2 deletions
|
@ -975,7 +975,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort correctly
|
// Sort correctly
|
||||||
if ($config['display_order'])
|
if (!$config['display_order'])
|
||||||
{
|
{
|
||||||
// Ascending sort
|
// Ascending sort
|
||||||
krsort($attachments);
|
krsort($attachments);
|
||||||
|
@ -1233,7 +1233,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||||
foreach ($matches[0] as $num => $capture)
|
foreach ($matches[0] as $num => $capture)
|
||||||
{
|
{
|
||||||
// Flip index if we are displaying the reverse way
|
// Flip index if we are displaying the reverse way
|
||||||
$index = ($config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num];
|
$index = (!$config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num];
|
||||||
|
|
||||||
$replace['from'][] = $matches[0][$num];
|
$replace['from'][] = $matches[0][$num];
|
||||||
$replace['to'][] = (isset($attachments[$index])) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
|
$replace['to'][] = (isset($attachments[$index])) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue