mirror of
https://github.com/friendica/friendica
synced 2025-04-24 04:30:11 +00:00
Allow colon in password
- It was disallowed because of a too strict intepretation of RFC2617
This commit is contained in:
parent
81cd334664
commit
d2033d4c92
4 changed files with 9 additions and 6 deletions
|
@ -61,7 +61,10 @@ class Token extends BaseApi
|
|||
}
|
||||
|
||||
if (empty($request['client_id']) && substr($authorization, 0, 6) == 'Basic ') {
|
||||
$datapair = explode(':', base64_decode(trim(substr($authorization, 6))));
|
||||
// Per RFC2617, usernames can't contain a colon but password can,
|
||||
// so we cut on the first colon to obtain the username and the password
|
||||
// @see https://www.rfc-editor.org/rfc/rfc2617#section-2
|
||||
$datapair = explode(':', base64_decode(trim(substr($authorization, 6))), 2);
|
||||
if (count($datapair) == 2) {
|
||||
$request['client_id'] = $datapair[0];
|
||||
$request['client_secret'] = $datapair[1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue