X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=twitter%2Ftwitter.php;h=ee3bd0fbda5467dcc85897f8e327a5bc9ff905c1;hb=0267222fb4a993aefde5c34a70941fe85d6c9eef;hp=3fcaa1de33517e47d67fc3334e49a42cf073b9ca;hpb=a06bd90965fefa85164550fab88d85b8a0f55beb;p=friendica-addons.git diff --git a/twitter/twitter.php b/twitter/twitter.php index 3fcaa1de..ee3bd0fb 100755 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -294,6 +294,9 @@ function twitter_shortenmsg($b) { $recycle = html_entity_decode("◌ ", ENT_QUOTES, 'UTF-8'); $body = preg_replace( '/'.$recycle.'\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', "\n", $body); + // remove the share element + $body = preg_replace("/\[share(.*?)\](.*?)\[\/share\]/ism","\n\n$2\n\n",$body); + // At first convert the text to html $html = bbcode($body, false, false); @@ -354,7 +357,7 @@ function twitter_shortenmsg($b) { $msg = substr($msg, 0, -1); $pos = strrpos($msg, "\n"); if ($pos > 0) - $msg = substr($msg, 0, $pos-1); + $msg = substr($msg, 0, $pos); else if ($lastchar != "\n") $msg = substr($msg, 0, -3)."..."; }