mirror of
https://github.com/twisterarmy/twister-phpbot.git
synced 2025-02-03 10:35:25 +00:00
mb_strrpos instead of loop
This commit is contained in:
parent
9c01a3d59b
commit
3893eff7b4
@ -129,10 +129,7 @@ class TwisterPost
|
||||
$text .= ' #' . str_replace(' ', '_', (string)$tag);
|
||||
}
|
||||
$text = mb_substr($text, 0, $maxLen + 1);
|
||||
$pos = $maxLen;
|
||||
while (mb_substr($text, $pos, 1) !== ' ') {
|
||||
$pos--;
|
||||
}
|
||||
$pos = mb_strrpos($text, ' ');
|
||||
$text = mb_substr($text, 0, $pos);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user