Commit 4b1763d3 authored by Max Kostikov's avatar Max Kostikov

Remove unnecessary code

parent 5a45944b
......@@ -179,7 +179,7 @@ function twitter_short_message(&$msg, $link, $limit, $shortlink = true) {
if (strlen($msg . " " . $link) > $limit) {
$msg = substr($msg, 0, ($limit - strlen($link)));
if (substr($msg, -1) != "\n")
$msg = rtrim(substr($msg, 0, strrpos($msg, " ")), "?.,:;!-") . "...";
$msg = rtrim(substr($msg, 0, strrpos($msg, " ")), "?.,:;!-)") . "...";
}
$msg .= " " . $link;
......@@ -216,7 +216,7 @@ function twitter_shortenmsg($b) {
// Choose first URL
$link = '';
if (preg_match('/\[url=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\]/is', $body, $matches))
$link = rtrim($matches[1], "?.,:;!");
$link = $matches[1];
// Add some newlines so that the message could be cut better
$body = str_replace(array("[quote", "[/quote]"), array("\n[quote", "[/quote]\n"), $body);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment