Fix Feed page
Fix TypeError: substr(): Argument #3 ($length) must be of type ?int, bool given
This commit is contained in:
parent
f8bebd067d
commit
309558e11e
1 changed files with 6 additions and 1 deletions
|
@ -164,7 +164,12 @@ class Feed extends Page
|
|||
{
|
||||
if (\mb_strlen($text, 'UTF-8') > self::MAX_LEN_CONT) {
|
||||
$result = \mb_substr($text, 0, self::MAX_LEN_CONT, 'UTF-8');
|
||||
$result = \substr($result, 0, \strrpos($result, ' '));
|
||||
$length = \strrpos($result, ' ');
|
||||
|
||||
if (\is_int($length)) {
|
||||
$result = \substr($result, 0, $length);
|
||||
}
|
||||
|
||||
$result = \rtrim($result, "!,.-\n\t ");
|
||||
|
||||
if (isset($result[0])) {
|
||||
|
|
Loading…
Add table
Reference in a new issue