X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapioauthrequesttoken.php;h=e961f4f46464cf8463af219ba41a45f5a0cfb460;hb=1776c90cb98d5ca738db143703fb998612ada31e;hp=478d2dbfc433c4e152b9f0f6626c5dabcd0b384e;hpb=9abe6fa66632f1a0ddbfa028e51c6676a4357d5c;p=quix0rs-gnu-social.git diff --git a/actions/apioauthrequesttoken.php b/actions/apioauthrequesttoken.php index 478d2dbfc4..e961f4f464 100644 --- a/actions/apioauthrequesttoken.php +++ b/actions/apioauthrequesttoken.php @@ -31,8 +31,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apioauth.php'; - /** * Issue temporary OAuth credentials (a request token) * @@ -42,8 +40,7 @@ require_once INSTALLDIR . '/lib/apioauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - -class ApiOauthRequestTokenAction extends ApiOauthAction +class ApiOAuthRequestTokenAction extends ApiOAuthAction { /** * Take arguments for running @@ -51,9 +48,7 @@ class ApiOauthRequestTokenAction extends ApiOauthAction * @param array $args $_REQUEST args * * @return boolean success flag - * */ - function prepare($args) { parent::prepare($args); @@ -74,12 +69,11 @@ class ApiOauthRequestTokenAction extends ApiOauthAction * * @return void */ - function handle($args) { parent::handle($args); - $datastore = new ApiStatusNetOAuthDataStore(); + $datastore = new ApiGNUsocialOAuthDataStore(); $server = new OAuthServer($datastore); $hmac_method = new OAuthSignatureMethod_HMAC_SHA1(); @@ -127,7 +121,6 @@ class ApiOauthRequestTokenAction extends ApiOauthAction /* * Display temporary OAuth credentials */ - function showRequestToken($token) { header('Content-Type: application/x-www-form-urlencoded'); @@ -142,11 +135,10 @@ class ApiOauthRequestTokenAction extends ApiOauthAction * * @return boolean true or false */ - function verifyCallback($callback) { if ($callback == "oob") { - common_debug("OAuth request token requested for out of bounds client."); + common_debug("OAuth request token requested for out of band client."); // XXX: Should we throw an error if a client is registered as a // web application but requests the pin based workflow? For now I'm @@ -154,11 +146,7 @@ class ApiOauthRequestTokenAction extends ApiOauthAction return true; } else { - return Validate::uri( - $callback, - array('allowed_schemes' => array('http', 'https')) - ); + return filter_var($callback, FILTER_VALIDATE_URL); } } - }