forked from GNUsocial/gnu-social
maxNoticeLength test for url-shortening failed on maxContent==0
maxContent==0 implies that a notice text can be infinitely long, but this value was directly transferred to maxNoticeLength, where 0 was tested if it was longer than the notice length - which of course always was false. This commit fixes the problem for infinite length notices that always got shortened.
This commit is contained in:
@@ -1046,7 +1046,7 @@ function common_shorten_links($text, $always = false, User $user=null)
|
||||
|
||||
$maxLength = User_urlshortener_prefs::maxNoticeLength($user);
|
||||
|
||||
if ($always || mb_strlen($text) > $maxLength) {
|
||||
if ($always || ($maxLength != -1 && mb_strlen($text) > $maxLength)) {
|
||||
return common_replace_urls_callback($text, array('File_redirection', 'forceShort'), $user);
|
||||
} else {
|
||||
return common_replace_urls_callback($text, array('File_redirection', 'makeShort'), $user);
|
||||
|
Reference in New Issue
Block a user