mirror of
https://github.com/twisterarmy/twister-phpbot.git
synced 2025-01-24 21:54:35 +00:00
fix removing of last tag in short messages
This commit is contained in:
parent
f84b99c862
commit
e314117563
@ -138,9 +138,11 @@ class TwisterPost
|
||||
$text .= ' #' . $tagText;
|
||||
}
|
||||
}
|
||||
$text = mb_substr($text, 0, $maxLen + 1);
|
||||
$pos = mb_strrpos($text, ' ');
|
||||
$text = mb_substr($text, 0, $pos);
|
||||
if(mb_strlen($text) > $maxLen) {
|
||||
$text = mb_substr($text, 0, $maxLen + 1);
|
||||
$pos = mb_strrpos($text, ' ');
|
||||
$text = mb_substr($text, 0, $pos);
|
||||
}
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
Loading…
x
Reference in New Issue
Block a user