From: Evan Prodromou Date: Fri, 21 Aug 2009 12:27:21 +0000 (-0400) Subject: api update correctly checks max length of notices X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cb2184ed448ecb043d825d4d12b8193d63c4d84c;p=quix0rs-gnu-social.git api update correctly checks max length of notices --- diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index e3d366ecc8..0382824142 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -242,14 +242,15 @@ class TwitapistatusesAction extends TwitterapiAction $status_shortened = common_shorten_links($status); - if (mb_strlen($status_shortened) > 140) { + if (Notice::contentTooLong($status_shortened)) { // XXX: Twitter truncates anything over 140, flags the status // as "truncated." Sending this error may screw up some clients // that assume Twitter will truncate for them. Should we just // truncate too? -- Zach - $this->clientError(_('That\'s too long. Max notice size is 140 chars.'), - $code = 406, $apidata['content-type']); + $this->clientError(sprintf(_('That\'s too long. Max notice size is %d chars.'), + Notice::maxContent()), + $code = 406, $apidata['content-type']); return; } }