mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/15403] Return first fragment of text if there is no coincidences
PHPBB-15403
This commit is contained in:
parent
68436c4a96
commit
95b8b50599
1 changed files with 2 additions and 2 deletions
|
@ -398,10 +398,10 @@ function get_context(string $text, array $words, int $length = 400)
|
|||
// Get the last fragment
|
||||
$fragments[] = $fragment;
|
||||
|
||||
$output = htmlentities(implode('', $fragments));
|
||||
return htmlentities(implode('', $fragments));
|
||||
}
|
||||
|
||||
return $output;
|
||||
return htmlentities($text_length >= $length + 3 ? utf8_substr($text, 0, $length) . ' ...' : $text);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue