Notice update with media attachment may fail through API when status text + attachment length get higher than max notice length. Calling URL shortener can make global length less than maxlength, though allowing notice update.

This commit is contained in:
Jean Baptiste Favre 2012-09-06 11:11:33 -04:00
parent 8cc4660bd9
commit 6387e0a90d

View File

@ -300,6 +300,9 @@ class ApiStatusesUpdateAction extends ApiAuthAction
if (isset($upload)) { if (isset($upload)) {
$status_shortened .= ' ' . $upload->shortUrl(); $status_shortened .= ' ' . $upload->shortUrl();
//JBTEST
$status_shortened = $this->auth_user->shortenlinks($status_shortened);
//JBTEST
if (Notice::contentTooLong($status_shortened)) { if (Notice::contentTooLong($status_shortened)) {
$upload->delete(); $upload->delete();