url-shortening check correctly checks max notice length

This commit is contained in:
Evan Prodromou 2009-08-21 08:16:08 -04:00
parent 3565383f77
commit 35bf388204
1 changed files with 2 additions and 1 deletions

View File

@ -570,7 +570,8 @@ function common_linkify($url) {
function common_shorten_links($text)
{
if (mb_strlen($text) <= 140) return $text;
$maxLength = Notice::maxContent();
if ($maxLength == 0 || mb_strlen($text) <= $maxLength) return $text;
return common_replace_urls_callback($text, array('File_redirection', 'makeShort'));
}