mirror of
https://github.com/friendica/friendica
synced 2025-04-30 07:44:22 +02:00
Use strtok to find QP's in Uri for OAuth redirect processing
This commit is contained in:
parent
89e105afbe
commit
35a726a961
2 changed files with 4 additions and 4 deletions
|
@ -131,8 +131,7 @@ class OAuth
|
|||
}
|
||||
|
||||
if (!empty($redirect_uri)) {
|
||||
$uri = new Uri($redirect_uri);
|
||||
$redirect_uri = $uri->getScheme() . '://' . $uri->getHost() . $uri->getPath();
|
||||
$redirect_uri = strtok($redirect_uri, '?');
|
||||
$condition = DBA::mergeConditions($condition, ["`redirect_uri` LIKE ?", '%' . $redirect_uri . '%']);
|
||||
}
|
||||
|
||||
|
@ -143,6 +142,7 @@ class OAuth
|
|||
}
|
||||
|
||||
// The redirect_uri could contain several URI that are separated by spaces.
|
||||
$exploded = explode(' ', $application['redirect_uri']);
|
||||
if (($application['redirect_uri'] != $redirect_uri) && !in_array($redirect_uri, explode(' ', $application['redirect_uri']))) {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue