Browse Source

fix removing of last tag in short messages

master
Denis Ryabov 11 years ago
parent
commit
e314117563
  1. 8
      twisterpost.php

8
twisterpost.php

@ -138,9 +138,11 @@ class TwisterPost @@ -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…
Cancel
Save