Ticket #925 - make verify_credentials return 'Authorized' if no return type specified

This commit is contained in:
Zach Copley 2009-02-22 17:01:41 -08:00
parent b9f3e1e01e
commit cdab8d55a9

View File

@ -24,20 +24,19 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
class TwitapiaccountAction extends TwitterapiAction class TwitapiaccountAction extends TwitterapiAction
{ {
function verify_credentials($args, $apidata) function verify_credentials($args, $apidata)
{ {
if ($apidata['content-type'] == 'xml') {
if ($apidata['content-type'] == 'xml') { header('Content-Type: application/xml; charset=utf-8');
header('Content-Type: application/xml; charset=utf-8'); print '<authorized>true</authorized>';
print '<authorized>true</authorized>'; } elseif ($apidata['content-type'] == 'json') {
} elseif ($apidata['content-type'] == 'json') { header('Content-Type: application/json; charset=utf-8');
header('Content-Type: application/json; charset=utf-8'); print '{"authorized":true}';
print '{"authorized":true}'; } else {
} else { header('Content-Type: text/html; charset=utf-8');
common_user_error(_('API method not found!'), $code=404); print 'Authorized';
} }
}
}
function end_session($args, $apidata) function end_session($args, $apidata)
{ {