diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-08-21 08:13:17 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-08-21 08:13:17 -0400 |
commit | 3eeb9deffbac17e49abe2789cd1578726a2bce97 (patch) | |
tree | 97de32c45ff4ce393783c4904ab14a872f586e72 /actions | |
parent | d5825893c8982a9856f0b7a1731c178160237cdf (diff) |
Web UI for notices correctly shows and checks max content length
Diffstat (limited to 'actions')
-rw-r--r-- | actions/newnotice.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php index e254eac49..f773fc880 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -162,9 +162,10 @@ class NewnoticeAction extends Action $this->clientError(_('No content!')); } else { $content_shortened = common_shorten_links($content); - if (mb_strlen($content_shortened) > 140) { - $this->clientError(_('That\'s too long. '. - 'Max notice size is 140 chars.')); + if (Notice::contentTooLong($content_shortened)) { + $this->clientError(sprintf(_('That\'s too long. '. + 'Max notice size is %d chars.'), + Notice::maxContent())); } } @@ -241,9 +242,10 @@ class NewnoticeAction extends Action $short_fileurl = common_shorten_url($fileurl); $content_shortened .= ' ' . $short_fileurl; - if (mb_strlen($content_shortened) > 140) { + if (Notice::contentTooLong($content_shortened)) { $this->deleteFile($filename); - $this->clientError(_('Max notice size is 140 chars, including attachment URL.')); + $this->clientError(sprintf(_('Max notice size is %d chars, including attachment URL.'), + Notice::maxContent())); } // Also, not sure this is necessary -- Zach |