Skip to content

Commit

Permalink
+= overwrites numeric indexes breaking when integration hooks are use…
Browse files Browse the repository at this point in the history
…d to add new columns to the join
  • Loading branch information
emanuele45 committed Apr 30, 2017
1 parent 78de41a commit 05b9d66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/subs/MessageIndex.subs.php
Expand Up @@ -83,10 +83,10 @@ function messageIndexTopics($id_board, $id_member, $start, $items_per_page, $sor
{
// If -1 means preview the whole body
if ($indexOptions['previews'] === -1)
$indexOptions['custom_selects'] += array('ml.body AS last_body', 'mf.body AS first_body');
$indexOptions['custom_selects'] = array_merge($indexOptions['custom_selects'], array('ml.body AS last_body', 'mf.body AS first_body'));
// Default: a SUBSTRING
elseif (!empty($indexOptions['previews']))
$indexOptions['custom_selects'] += array('SUBSTRING(ml.body, 1, ' . ($indexOptions['previews'] + 256) . ') AS last_body', 'SUBSTRING(mf.body, 1, ' . ($indexOptions['previews'] + 256) . ') AS first_body');
$indexOptions['custom_selects'] = array_merge($indexOptions['custom_selects'], array('SUBSTRING(ml.body, 1, ' . ($indexOptions['previews'] + 256) . ') AS last_body', 'SUBSTRING(mf.body, 1, ' . ($indexOptions['previews'] + 256) . ') AS first_body'));

if (!empty($indexOptions['include_avatars']))
{
Expand Down

0 comments on commit 05b9d66

Please sign in to comment.