Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
oauth_2-0_client_php
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Bastian Hofmann
2011-03-30 17:52:57 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6e37651bf0992446ad65227d159039ab3938a380
6e37651b
1 parent
7341bd7e
fixed post parameter passing if access token should only be sent in header
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
oauth2.php
oauth2.php
View file @
6e37651
...
...
@@ -276,15 +276,22 @@ class OAuth2_Service
if
(
$method
!==
'GET'
)
{
if
(
is_array
(
$postBody
))
{
$postBody
[
'oauth_token'
]
=
$token
->
getAccessToken
();
$parameters
=
http_build_query
(
$postBody
);
}
else
{
$postBody
.=
'&oauth_token='
.
urlencode
(
$token
->
getAccessToken
());
$parameters
=
$postBody
;
}
}
else
{
$uriParameters
[
'oauth_token'
]
=
$token
->
getAccessToken
();
}
}
if
(
$method
!==
'GET'
)
{
if
(
is_array
(
$postBody
))
{
$parameters
=
http_build_query
(
$postBody
);
}
else
{
$parameters
=
$postBody
;
}
}
if
(
!
empty
(
$uriParameters
))
{
$endpoint
.=
(
strpos
(
$endpoint
,
'?'
)
!==
false
?
'&'
:
'?'
)
.
http_build_query
(
$uriParameters
);
}
...
...
Please
register
or
login
to post a comment