DEV: Незначительные изменения
This commit is contained in:
parent
45e79d5eb7
commit
182bf08f96
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in a new issue