From: Craig Andrews Date: Thu, 10 Sep 2009 02:57:15 +0000 (-0400) Subject: If a shortened URL begins with http://, don't include it in the shortened url. Saves... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e2848eb8621dd645fa68cb1641c0af1df5530408;p=quix0rs-gnu-social.git If a shortened URL begins with http://, don't include it in the shortened url. Saves 7 characters, which is pretty awesome for 140 character max length notices. --- diff --git a/lib/util.php b/lib/util.php index 256acf1993..3e95d2bea3 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1414,6 +1414,9 @@ function common_shorten_url($long_url) curl_close($curlh); + if(substr($short_url,0,7)=='http://'){ + $short_url = substr($short_url,7); + } return $short_url; }