summaryrefslogtreecommitdiff
path: root/actions/twitapifriendships.php
diff options
context:
space:
mode:
authorzach <zach@controlyourself.ca>2008-09-30 22:09:59 -0400
committerzach <zach@controlyourself.ca>2008-09-30 22:09:59 -0400
commitdec2f29c6a77dd97383ebdbabdc0bff8e524bfa4 (patch)
treebc14f25539cfdf85adf746bb9813f2bf0b5c3370 /actions/twitapifriendships.php
parentc08a67094cb848e8bcd8f631aa44adf57a33b7ab (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/twitapifriendships.php')
-rw-r--r--actions/twitapifriendships.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php
index d97b7c08e..f9ff251d6 100644
--- a/actions/twitapifriendships.php
+++ b/actions/twitapifriendships.php
@@ -152,6 +152,11 @@ class TwitapifriendshipsAction extends TwitterapiAction {
function exists($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_a_id = $this->trimmed('user_a');
$user_b_id = $this->trimmed('user_b');
@@ -181,7 +186,6 @@ class TwitapifriendshipsAction extends TwitterapiAction {
$this->end_document('json');
break;
default:
- print $result; // Really? --Zach
break;
}