Statusnet/Twitter URL could be cut in the smart shortening function

pull/82/head
Michael Vogel 2012-11-08 21:44:32 +01:00
parent 81b0a1c2d0
commit 0857ae55c3
2 changed files with 6 additions and 0 deletions

View File

@ -451,6 +451,9 @@ function statusnet_shortenmsg($b, $max_char) {
while (strpos($msg, " ") !== false) while (strpos($msg, " ") !== false)
$msg = str_replace(" ", " ", $msg); $msg = str_replace(" ", " ", $msg);
// Removing URLs
$msg = preg_replace('/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', "", $msg);
$msg = trim($msg); $msg = trim($msg);
$link = ''; $link = '';

View File

@ -310,6 +310,9 @@ function twitter_shortenmsg($b) {
while (strpos($msg, " ") !== false) while (strpos($msg, " ") !== false)
$msg = str_replace(" ", " ", $msg); $msg = str_replace(" ", " ", $msg);
// Removing URLs
$msg = preg_replace('/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', "", $msg);
$msg = trim($msg); $msg = trim($msg);
$link = ''; $link = '';