diff options
author | millette <millette@controlyourself.ca> | 2008-11-06 15:59:26 -0500 |
---|---|---|
committer | millette <millette@controlyourself.ca> | 2008-11-06 15:59:26 -0500 |
commit | 15c1d4f5e4947b9c60439ab5a17694ad57d06704 (patch) | |
tree | 4139f40409a3765a9a4dbf4b6922fd7232f43441 /actions/twitapistatuses.php | |
parent | 1e8d26baecad6ca1088ea7815fe2615fb520a10e (diff) |
trac31 url_auto_shortening by sgmurphy
darcs-hash:20081106205926-099f7-6bcfd7969a159a12b1ba6a9ee254e44a07b94761.gz
Diffstat (limited to 'actions/twitapistatuses.php')
-rw-r--r-- | actions/twitapistatuses.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 539a0b1b3..ca79feb4c 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -253,13 +253,19 @@ class TwitapistatusesAction extends TwitterapiAction { return; } else if (mb_strlen($status) > 140) { + + $status = common_shorten_links($status); - // 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->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']); - return; + if (mb_strlen($status) > 140) { + + // 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->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']); + return; + + } } // Check for commands |