+
+ // Will the text be shortened in the link?
+ // Or is the link the last item in the post?
+ if (($limit > 0) AND ($pos < $limit) AND (($pos + 23 > $limit) OR ($pos + strlen($link) == strlen($msg))))
+ $msg = trim(str_replace($link, "", $msg));
+ elseif (($limit == 0) OR ($pos < $limit)) {
+ // The limit has to be increased since it will be shortened - but not now
+ // Only do it with Twitter (htmlmode = 8)
+ if (($limit > 0) AND (strlen($link) > 23) AND ($htmlmode == 8))
+ $limit = $limit - 23 + strlen($link);
+