summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-25 10:30:37 -0800
committerBrion Vibber <brion@pobox.com>2010-02-25 10:30:37 -0800
commit39a8e9d8e679cfd02e47fa93aa26373101515cf9 (patch)
tree12f1cc66d06e34db12a2f8f048f19b92c310d0ad /lib
parent4a71753f2046a17a98c139cc308ff7f77bd4f271 (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php3
1 files changed, 2 insertions, 1 deletions
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);
}
}