summaryrefslogtreecommitdiff
path: root/actions/twitapistatuses.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-21 08:27:21 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-08-21 08:27:21 -0400
commitcb2184ed448ecb043d825d4d12b8193d63c4d84c (patch)
treea3ce3f4636bac093ddfcacb63da37565a6af71c9 /actions/twitapistatuses.php
parentd1cc159a0423c84a74ba416af2878db6186899a8 (diff)
api update correctly checks max length of notices
Diffstat (limited to 'actions/twitapistatuses.php')
-rw-r--r--actions/twitapistatuses.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php
index e3d366ecc..038282414 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;
}
}