From 15c1d4f5e4947b9c60439ab5a17694ad57d06704 Mon Sep 17 00:00:00 2001 From: millette Date: Thu, 6 Nov 2008 15:59:26 -0500 Subject: trac31 url_auto_shortening by sgmurphy darcs-hash:20081106205926-099f7-6bcfd7969a159a12b1ba6a9ee254e44a07b94761.gz --- actions/twitapidirect_messages.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'actions/twitapidirect_messages.php') diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index a0a09a410..3037890ad 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -113,9 +113,12 @@ class Twitapidirect_messagesAction extends TwitterapiAction { if (!$content) { $this->client_error(_('No message text!'), $code = 406, $apidata['content-type']); } else if (mb_strlen($status) > 140) { - $this->client_error(_('That\'s too long. Max message size is 140 chars.'), - $code = 406, $apidata['content-type']); - return; + $status = common_shorten_links($status); + if (mb_strlen($status) > 140) { + $this->client_error(_('That\'s too long. Max message size is 140 chars.'), + $code = 406, $apidata['content-type']); + return; + } } $other = $this->get_user($this->trimmed('user')); -- cgit v1.2.3-54-g00ecf