From dec2f29c6a77dd97383ebdbabdc0bff8e524bfa4 Mon Sep 17 00:00:00 2001 From: zach Date: Tue, 30 Sep 2008 22:09:59 -0400 Subject: 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 --- actions/twitapihelp.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'actions/twitapihelp.php') diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php index 2ac4178de..d2439484c 100644 --- a/actions/twitapihelp.php +++ b/actions/twitapihelp.php @@ -23,7 +23,7 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapihelpAction extends TwitterapiAction { - function is_readonly() { + function is_readonly() { return true; } @@ -32,7 +32,8 @@ class TwitapihelpAction extends TwitterapiAction { * Formats: xml, json */ function test($args, $apidata) { - global $xw; + parent::handle($args); + if ($apidata['content-type'] == 'xml') { $this->init_document('xml'); common_element('ok', NULL, 'true'); @@ -52,5 +53,5 @@ class TwitapihelpAction extends TwitterapiAction { common_server_error(_('API method under construction.'), $code=501); exit(); } - + } \ No newline at end of file -- cgit v1.2.3-54-g00ecf