X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ftwitapistatuses.php;h=3041240dded4dd59fdff76e5da2f49f0f0637672;hb=c55e3089c555c0a9f12b997f25b7f4f397a0e2c6;hp=2dcff985c816c2d04e5fb73e371543758ef56cbe;hpb=55f5bea21ebb29266c4a4c8068057928fa4504bf;p=quix0rs-gnu-social.git diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 2dcff985c8..3041240dde 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -61,7 +61,10 @@ class TwitapistatusesAction extends TwitterapiAction { # XXX: sub-optimal performance - $notice->is_local = 1; + if (common_config('public', 'localonly')) { + $notice->is_local = 1; + } + $notice->orderBy('created DESC, notice.id DESC'); $notice->limit($MAX_PUBSTATUSES); $cnt = $notice->find(); @@ -374,6 +377,11 @@ class TwitapistatusesAction extends TwitterapiAction { parent::handle($args); + if ($_SERVER['REQUEST_METHOD'] != 'POST') { + $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + exit(); + } + $user = $apidata['user']; $status = $this->trimmed('status'); $source = $this->trimmed('source'); @@ -543,10 +551,8 @@ class TwitapistatusesAction extends TwitterapiAction { $this->show_single_json_status($notice); } } else { - - // XXX: This is all that Twitter does. It doesn't show an XML or JSON error msg. - // Should we call client_error() to be more consistent? - header('HTTP/1.1 404 Not Found'); + // XXX: Twitter just sets a 404 header and doens't bother to return an err msg + $this->client_error(_('No status with that ID found.'), 404, $apidata['content-type']); } exit();