diff options
Diffstat (limited to 'actions/twitapistatuses.php')
-rw-r--r-- | actions/twitapistatuses.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 3271f1e28..ed6c224fa 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -297,6 +297,11 @@ class TwitapistatusesAction extends TwitterapiAction { parent::handle($args); + if (!in_array($apidata['content-type'], array('xml', 'json'))) { + common_user_error(_('API method not found!'), $code = 404); + exit; + } + if ($_SERVER['REQUEST_METHOD'] != 'POST') { $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); exit(); @@ -448,6 +453,11 @@ class TwitapistatusesAction extends TwitterapiAction { function show($args, $apidata) { parent::handle($args); + if (!in_array($apidata['content-type'], array('xml', 'json'))) { + common_user_error(_('API method not found!'), $code = 404); + exit; + } + $notice_id = $apidata['api_arg']; $notice = Notice::staticGet($notice_id); @@ -485,6 +495,11 @@ class TwitapistatusesAction extends TwitterapiAction { parent::handle($args); + if (!in_array($apidata['content-type'], array('xml', 'json'))) { + common_user_error(_('API method not found!'), $code = 404); + exit; + } + // Check for RESTfulness if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { // XXX: Twitter just prints the err msg, no XML / JSON. |