From 9b97adc7adf3deb6ac977a286191455f22ce2c6d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 13 Aug 2012 14:33:19 -0400 Subject: [PATCH] Squashed commit of the following: commit 2b9bce9ef8f6cf55b7ac62231bcc0173260ba472 Merge: 3ba4f24 12b680e Author: Evan Prodromou Date: Mon Aug 13 14:31:46 2012 -0400 Merge commit 'refs/merge-requests/207' of git://gitorious.org/statusnet/mainline into merge-requests/207 commit 12b680e375db9de01cac77dd9a71adb729292dc7 Author: Mikael Nordfeldth Date: Fri Aug 10 20:49:52 2012 +0200 testing whether $user is predefined before otherwise setting it to common_current_user() --- lib/util.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index a061d17739..4a87f9a217 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1040,7 +1040,9 @@ function common_linkify($url) { */ function common_shorten_links($text, $always = false, User $user=null) { - $user = common_current_user(); + if ($user === null) { + $user = common_current_user(); + } $maxLength = User_urlshortener_prefs::maxNoticeLength($user);