Merge remote-tracking branch 'upstream/develop' into api

This commit is contained in:
Michael 2023-01-22 19:11:21 +00:00
commit b2d7c4ec43
83 changed files with 1458 additions and 936 deletions

View file

@ -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];