X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fnewnotice.php;h=f773fc880e5328ae1f232252c84e8d79d6703eb9;hb=1285c11d0a913bc1590e91de42a4335c7ac4119d;hp=5f44a32a96a5601a2582a9dbdb66f39b3f27e6d0;hpb=bfae5489cb629331f2936b2bf1066adb3976bce1;p=quix0rs-gnu-social.git diff --git a/actions/newnotice.php b/actions/newnotice.php index 5f44a32a96..f773fc880e 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -135,7 +135,7 @@ class NewnoticeAction extends Action function isRespectsQuota($user) { $file = new File; - $ret = $file->isRespectsQuota($user); + $ret = $file->isRespectsQuota($user,$_FILES['attach']['size']); if (true === $ret) return true; $this->clientError($ret); } @@ -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