From: Evan Prodromou Date: Mon, 13 Aug 2012 18:33:19 +0000 (-0400) Subject: Squashed commit of the following: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9b97adc7adf3deb6ac977a286191455f22ce2c6d;p=quix0rs-gnu-social.git 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() --- 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);