From: Michael Vogel Date: Thu, 8 Nov 2012 20:44:32 +0000 (+0100) Subject: Statusnet/Twitter URL could be cut in the smart shortening function X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0857ae55c36d2b560e18deddecad8d2fe0d4b6b4;p=friendica-addons.git Statusnet/Twitter URL could be cut in the smart shortening function --- diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 555f8dbb..c8330a7e 100755 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -451,6 +451,9 @@ function statusnet_shortenmsg($b, $max_char) { while (strpos($msg, " ") !== false) $msg = str_replace(" ", " ", $msg); + // Removing URLs + $msg = preg_replace('/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', "", $msg); + $msg = trim($msg); $link = ''; diff --git a/twitter/twitter.php b/twitter/twitter.php index 82d059ee..3fcaa1de 100755 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -310,6 +310,9 @@ function twitter_shortenmsg($b) { while (strpos($msg, " ") !== false) $msg = str_replace(" ", " ", $msg); + // Removing URLs + $msg = preg_replace('/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', "", $msg); + $msg = trim($msg); $link = '';