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);