forked from GNUsocial/gnu-social
API for direct messages correctly checks length
This commit is contained in:
parent
de5382d4ca
commit
2b2541e4b4
@ -141,8 +141,9 @@ class Twitapidirect_messagesAction extends TwitterapiAction
|
|||||||
$code = 406, $apidata['content-type']);
|
$code = 406, $apidata['content-type']);
|
||||||
} else {
|
} else {
|
||||||
$content_shortened = common_shorten_links($content);
|
$content_shortened = common_shorten_links($content);
|
||||||
if (mb_strlen($content_shortened) > 140) {
|
if (Message::contentTooLong($content_shortened)) {
|
||||||
$this->clientError(_('That\'s too long. Max message size is 140 chars.'),
|
$this->clientError(sprintf(_('That\'s too long. Max message size is %d chars.'),
|
||||||
|
Message::maxContent()),
|
||||||
$code = 406, $apidata['content-type']);
|
$code = 406, $apidata['content-type']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user