summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-21 07:32:08 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-08-21 07:32:08 -0400
commit2b2541e4b4eae5dcdfc6c921e12ad8974b31f125 (patch)
treea9e08bbdd9a1184cbea32f842798f23df392a47d
parentde5382d4caaf0b388a4de0243cde9a783a43a541 (diff)
API for direct messages correctly checks length
-rw-r--r--actions/twitapidirect_messages.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php
index bd27e9d20..aac7d63b1 100644
--- a/actions/twitapidirect_messages.php
+++ b/actions/twitapidirect_messages.php
@@ -141,9 +141,10 @@ class Twitapidirect_messagesAction extends TwitterapiAction
$code = 406, $apidata['content-type']);
} else {
$content_shortened = common_shorten_links($content);
- if (mb_strlen($content_shortened) > 140) {
- $this->clientError(_('That\'s too long. Max message size is 140 chars.'),
- $code = 406, $apidata['content-type']);
+ if (Message::contentTooLong($content_shortened)) {
+ $this->clientError(sprintf(_('That\'s too long. Max message size is %d chars.'),
+ Message::maxContent()),
+ $code = 406, $apidata['content-type']);
return;
}
}