]> git.mxchange.org Git - friendica-addons.git/commitdiff
Statusnet/Twitter URL could be cut in the smart shortening function
authorMichael Vogel <icarus@dabo.de>
Thu, 8 Nov 2012 20:44:32 +0000 (21:44 +0100)
committerMichael Vogel <icarus@dabo.de>
Thu, 8 Nov 2012 20:44:32 +0000 (21:44 +0100)
statusnet/statusnet.php
twitter/twitter.php

index 555f8dbb1de9af26b74b9f3dc7fd2cc39f1ffcac..c8330a7e5291cf7f58954ff9aa1cd1ecdcd6a2e9 100755 (executable)
@@ -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 = '';
index 82d059ee2d28954e240130489784a1c38a8bbd80..3fcaa1de33517e47d67fc3334e49a42cf073b9ca 100755 (executable)
@@ -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 = '';