From 0857ae55c36d2b560e18deddecad8d2fe0d4b6b4 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 8 Nov 2012 21:44:32 +0100 Subject: [PATCH] Statusnet/Twitter URL could be cut in the smart shortening function --- statusnet/statusnet.php | 3 +++ twitter/twitter.php | 3 +++ 2 files changed, 6 insertions(+) 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 = '';