From: Evan Prodromou Date: Fri, 21 Aug 2009 11:32:08 +0000 (-0400) Subject: API for direct messages correctly checks length X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b2541e4b4eae5dcdfc6c921e12ad8974b31f125;p=quix0rs-gnu-social.git API for direct messages correctly checks length --- diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index bd27e9d20a..aac7d63b13 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; } }