DrupalOAuthRequest.inc in OAuth 1.0 6.3
File
includes/DrupalOAuthRequest.inc
View source
<?php
class DrupalOAuthRequest extends OAuthRequest {
public static function from_request($http_method = NULL, $http_url = NULL, $parameters = NULL) {
if ($parameters == NULL) {
$qs = $_SERVER['QUERY_STRING'];
$q = $_GET['q'];
if (isset($_SERVER['REDIRECT_URL'])) {
$q = FALSE;
}
elseif (isset($_GET['q'])) {
$get = array();
parse_str($_SERVER['QUERY_STRING'], $get);
if (isset($get['q'])) {
$q = $get['q'];
}
else {
$q = FALSE;
}
}
$parsed = array();
parse_str($_SERVER['QUERY_STRING'], $parsed);
if ($q === FALSE) {
unset($parsed['q']);
}
else {
$parsed['q'] = $q;
}
$_SERVER['QUERY_STRING'] = http_build_query($parsed, '', '&');
}
$req = parent::from_request($http_method, $http_url, $parameters);
if (isset($qs)) {
$_SERVER['QUERY_STRING'] = $qs;
}
return $req;
}
}