mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 13:09:44 +05:30
Added redirectUri function
This commit is contained in:
parent
11995764ba
commit
fd90e76c91
@ -173,4 +173,32 @@ class Server
|
|||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the redirect uri with appended params
|
||||||
|
*
|
||||||
|
* @param string $redirect_uri The redirect URI
|
||||||
|
* @param array $params The parameters to be appended to the URL
|
||||||
|
* @param string $query_delimeter The delimiter between the variables and the URL
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function redirectUri(string $redirectUri, $params = array(),
|
||||||
|
$queryDelimeter = '?') {
|
||||||
|
|
||||||
|
if (strstr($redirectUri, $queryDelimeter)) {
|
||||||
|
|
||||||
|
$redirectUri = $redirectUri . '&' . http_build_query($params);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$redirectUri = $redirectUri . $queryDelimeter .
|
||||||
|
http_build_query($params);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $redirectUri;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user