Skip to content

Commit

Permalink
Merge pull request #8296 from Sesquipedalian/post_previews
Browse files Browse the repository at this point in the history
Fixes issues when getting post previews for message index
  • Loading branch information
Sesquipedalian authored Jul 20, 2024
2 parents 1a7d5fb + 4902dbf commit 8b02c9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Actions/MessageIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public static function buildTopicContext(array $row): void
$row['first_body'] = strip_tags(strtr(BBCodeParser::load()->parse($row['first_body'], (bool) $row['first_smileys'], (int) $row['id_first_msg']), ['<br>' => '&#10;']));

if (Utils::entityStrlen($row['first_body']) > Config::$modSettings['preview_characters']) {
$row['first_body'] = Utils::entitySubstr($row['first_body'], 0, Config::$modSettings['preview_characters']) . '...';
$row['first_body'] = Utils::entitySubstr($row['first_body'], 0, (int) Config::$modSettings['preview_characters']) . '...';
}

// Censor the subject and message preview.
Expand All @@ -262,7 +262,7 @@ public static function buildTopicContext(array $row): void
$row['last_body'] = strip_tags(strtr(BBCodeParser::load()->parse($row['last_body'], (bool) $row['last_smileys'], (int) $row['id_last_msg']), ['<br>' => '&#10;']));

if (Utils::entityStrlen($row['last_body']) > Config::$modSettings['preview_characters']) {
$row['last_body'] = Utils::entitySubstr($row['last_body'], 0, Config::$modSettings['preview_characters']) . '...';
$row['last_body'] = Utils::entitySubstr($row['last_body'], 0, (int) Config::$modSettings['preview_characters']) . '...';
}

Lang::censorText($row['last_subject']);
Expand Down
1 change: 1 addition & 0 deletions Sources/BBCodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4216,6 +4216,7 @@ protected function resetRuntimeProperties(): void
// Reset these properties.
$to_reset = [
'message',
'bbc_codes',
'smileys',
'parse_tags',
'open_tags',
Expand Down

0 comments on commit 8b02c9c

Please sign in to comment.