Skip to content

Commit

Permalink
Fix the actual problem, not the perceived problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldiesmann committed Jul 7, 2024
1 parent a02e061 commit fd4b937
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sources/ServerSideIncludes.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public static function queryPosts(
$request = Db::$db->query(
'substring',
'SELECT
m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg, m.id_board, m.likes, b.name AS board_name,
m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg, m.id_board, m.likes, m.version, b.name AS board_name,
COALESCE(mem.real_name, m.poster_name) AS poster_name, ' . (User::$me->is_guest ? '1 AS is_read, 0 AS new_from' : '
COALESCE(lt.id_msg, lmr.id_msg, 0) >= m.id_msg_modified AS is_read,
COALESCE(lt.id_msg, lmr.id_msg, -1) + 1 AS new_from') . ', ' . ($limit_body ? 'SUBSTRING(m.body, 1, 384) AS body' : 'm.body') . ', m.smileys_enabled
Expand Down Expand Up @@ -518,7 +518,7 @@ public static function queryPosts(

// Old SMF versions autolinked during output rather than input,
// so maintain expected behaviour for those old messages.
if (empty($row['version']) || version_compare($row['version'], '3.0', '<')) {
if (version_compare($row['version'], '3.0', '<')) {
$row['body'] = Autolinker::load(true)->makeLinks($row['body']);
}

Expand Down Expand Up @@ -2188,7 +2188,8 @@ public static function boardNews(?int $board = null, ?int $limit = null, ?int $s
'',
'SELECT
m.icon, m.subject, m.body, COALESCE(mem.real_name, m.poster_name) AS poster_name, m.poster_time, m.likes,
t.num_replies, t.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, t.id_last_msg, m.id_board
t.num_replies, t.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, t.id_last_msg, m.id_board,
m.version
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
Expand Down

0 comments on commit fd4b937

Please sign in to comment.