Compare commits

...

6 commits

Author SHA1 Message Date
Marc Alexander
a05ce5fd59
Merge branch '3.3.x' 2024-04-28 21:07:56 +02:00
Marc Alexander
844bf0141f
Merge pull request #6602 from Crizz0/ticket/17306-master
[ticket/17306] Add type declaration to get_context and array for $words (for Master)
2024-04-28 21:07:52 +02:00
Marc Alexander
df43810f55
Merge pull request #6600 from Crizz0/ticket/17306
[ticket/17306] Add type declaration to get_context and array for $words
2024-04-28 21:07:08 +02:00
Marc Alexander
03ac7a6d5e
Merge branch 'ticket/17306' into ticket/17306-master 2024-04-21 21:22:55 +02:00
Christian Schnegelberger
8f1a777c5f
[ticket/17306] Add type declaration to get_context and array for $words
PHPBB3-17306
2024-04-21 21:22:46 +02:00
Christian Schnegelberger
17a50027b1
[ticket/17306] Change type description for get_context()
PHPBB3-17306
2024-04-21 21:21:09 +02:00

View file

@ -324,7 +324,7 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po
*
* @return string Context of the specified words separated by "..."
*/
function get_context($text, $words, $length = 400)
function get_context(string $text, array $words, int $length = 400)
{
// first replace all whitespaces with single spaces
$text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", ' '));