diff options
author | zach <zach@controlyourself.ca> | 2008-09-30 22:09:59 -0400 |
---|---|---|
committer | zach <zach@controlyourself.ca> | 2008-09-30 22:09:59 -0400 |
commit | dec2f29c6a77dd97383ebdbabdc0bff8e524bfa4 (patch) | |
tree | bc14f25539cfdf85adf746bb9813f2bf0b5c3370 /actions/twitapiusers.php | |
parent | c08a67094cb848e8bcd8f631aa44adf57a33b7ab (diff) |
Twitter-compatible API - Added content-type checks to several methods. Calling an API
method with a bad content type used to return a blank page.
darcs-hash:20081001020959-462f3-83b0241ba7dc99c4e3a52148a46deb8182e005b0.gz
Diffstat (limited to 'actions/twitapiusers.php')
-rw-r--r-- | actions/twitapiusers.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index cb682695a..b43a64152 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -51,6 +51,11 @@ class TwitapiusersAction 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; + } + $user = null; $email = $this->arg('email'); @@ -118,9 +123,7 @@ class TwitapiusersAction extends TwitterapiAction { $this->init_document('json'); $this->show_json_objects($twitter_user); $this->end_document('json'); - } else { - common_user_error(_('API method not found!'), $code = 404); - } + } exit(); } |