From 39a8e9d8e679cfd02e47fa93aa26373101515cf9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 25 Feb 2010 10:30:37 -0800 Subject: 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. --- lib/util.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index 9354431f2..9c50d9931 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); } } -- cgit v1.2.3-54-g00ecf