aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2018-03-10 15:43:13 -0500
committerAndrew Manning <tamanning@zoho.com>2018-03-10 15:43:13 -0500
commitaa6f7481a023c04b30ffc6aec2016e2b7b3b386f (patch)
tree38ea74a6e58bc6f42e5b2568485f6c34e40adfda /Zotlabs
parenta4de63ca923583b77cf2a4ad60f4893e006f90e4 (diff)
downloadvolse-hubzilla-aa6f7481a023c04b30ffc6aec2016e2b7b3b386f.tar.gz
volse-hubzilla-aa6f7481a023c04b30ffc6aec2016e2b7b3b386f.tar.bz2
volse-hubzilla-aa6f7481a023c04b30ffc6aec2016e2b7b3b386f.zip
Fixed access_token request bug and returned oauth2-server-php library to unmodified state.
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Oauth2testvehicle.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/Zotlabs/Module/Oauth2testvehicle.php b/Zotlabs/Module/Oauth2testvehicle.php
index 29c6ec50e..82e309f1c 100644
--- a/Zotlabs/Module/Oauth2testvehicle.php
+++ b/Zotlabs/Module/Oauth2testvehicle.php
@@ -145,13 +145,14 @@ class OAuth2TestVehicle extends \Zotlabs\Web\Controller {
$client_id = (x($_POST, 'client_id') ? $_POST['client_id'] : '');
$code = (x($_POST, 'code') ? $_POST['code'] : '');
$client_secret = (x($_POST, 'client_secret') ? $_POST['client_secret'] : '');
- $url = z_root() . '/token/?';
- $url .= 'grant_type=' . $grant_type;
- $url .= '&redirect_uri=' . urlencode($redirect_uri);
- $url .= '&client_id=' . $client_id;
- $url .= '&code=' . $code;
- $post = z_fetch_url($url, false, 0, array(
- 'custom' => 'POST',
+ $url = z_root() . '/token/';
+ $params = http_build_query(array(
+ 'grant_type' => $grant_type,
+ 'redirect_uri' => urlencode($redirect_uri),
+ 'client_id' => $client_id,
+ 'code' => $code,
+ ));
+ $post = z_post_url($url, $params, 0, array(
'http_auth' => $client_id . ':' . $client_secret,
));
logger(json_encode($post, JSON_PRETTY_PRINT), LOGGER_DEBUG);