push length check to Notice class

This commit is contained in:
Evan Prodromou 2009-06-12 09:47:57 -07:00
parent 1a077b0a7f
commit ce6285d0fc
1 changed files with 6 additions and 1 deletions

View File

@ -123,7 +123,12 @@ class Notice extends Memcached_DataObject
$profile = Profile::staticGet($profile_id);
$final = common_shorten_links($content);
$final = common_shorten_links($content);
if (mb_strlen($final) > 140) {
common_log(LOG_INFO, 'Rejecting notice that is too long.');
return _('Problem saving notice. Too long.');
}
if (!$profile) {
common_log(LOG_ERR, 'Problem saving notice. Unknown user.');