while (strpos($msg, " ") !== false)
$msg = str_replace(" ", " ", $msg);
+ $origmsg = $msg;
+
// Removing URLs
$msg = preg_replace('/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', "", $msg);
if (($msglink == "") and strlen($msg) > $max_char)
$msglink = $b["plink"];
+ // If the message is short enough then don't modify it. (if the link exists in the original message)
+ if ((strlen(trim($origmsg)) <= $max_char) AND (strpos($origmsg, $msglink) OR ($msglink == "")))
+ return(array("msg"=>trim($origmsg), "image"=>""));
+
if (strlen($msglink) > 20)
$msglink = short_link($msglink);
while (strpos($msg, " ") !== false)
$msg = str_replace(" ", " ", $msg);
+ $origmsg = $msg;
+
// Removing URLs
$msg = preg_replace('/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', "", $msg);
if (($msglink == "") and strlen($msg) > $max_char)
$msglink = $b["plink"];
+ // If the message is short enough then don't modify it. (if the link exists in the original message)
+ if ((strlen(trim($origmsg)) <= $max_char) AND (strpos($origmsg, $msglink) OR ($msglink == "")))
+ return(trim($origmsg));
+
if (strlen($msglink) > 20)
$msglink = short_link($msglink);