DEV: Незначительные изменения

This commit is contained in:
Evg 2023-10-02 06:09:27 +03:00
parent 45e79d5eb7
commit 182bf08f96
2 changed files with 5 additions and 1 deletions

View file

@ -24,6 +24,8 @@ class Filter
return self::fragment($str, $lenght);
}
// https://github.com/paragonie/constant_time_encoding/issues/26
// https://bugs.php.net/bug.php?id=80363
public static function fragment(string $text, int $lenght = 150, string $charset = 'UTF-8')
{
if (mb_strlen($text, $charset) >= $lenght) {
@ -31,6 +33,8 @@ class Filter
return mb_substr($wrap, 0, mb_strpos($wrap, '~', 0, $charset), $charset) . '...';
}
if (empty($text)) $text = '...';
return $text;
}
}

View file

@ -15,7 +15,7 @@
<?= Img::avatar($msg['msg_user']['avatar'], $msg['msg_user']['login'], 'img-base', 'small'); ?>
<?= $msg['msg_user']['login']; ?> <span class="lowercase"><?= Html::langDate($msg['dialog_update_time']); ?></span>
<?php endif; ?>
<div class="gray"><?= fragment($msg['message']['message_content'], 38); ?>...</div>
<div class="gray"><?= fragment($msg['message']['message_content'], 38); ?></div>
</div>
<div class="lowercase text-sm right gray-600">