From: Brion Vibber Date: Thu, 25 Feb 2010 18:30:37 +0000 (-0800) Subject: Ensure that shortened URLs haven't accumulated whitespace when fetched by a plugin... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=39a8e9d8e679cfd02e47fa93aa26373101515cf9;p=quix0rs-gnu-social.git Ensure that shortened URLs haven't accumulated whitespace when fetched by a plugin. Some shorteners have ended up inserting extra newlines when the string gets extracted from tidied HTML. --- diff --git a/lib/util.php b/lib/util.php index 9354431f27..9c50d9931f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1606,6 +1606,7 @@ function common_database_tablename($tablename) */ function common_shorten_url($long_url) { + $long_url = trim($long_url); $user = common_current_user(); if (empty($user)) { // common current user does not find a user when called from the XMPP daemon @@ -1620,7 +1621,7 @@ function common_shorten_url($long_url) return $long_url; }else{ //URL was shortened, so return the result - return $shortenedUrl; + return trim($shortenedUrl); } }