Issue 14478: Fix OAuth registration with Buffer

This commit is contained in:
Michael 2024-10-25 19:52:47 +00:00
parent 3b6030346f
commit 63b1adecea

View file

@ -129,8 +129,9 @@ class OAuth
return [];
}
// The redirect_uri could contain several URI that are separated by spaces.
if (($application['redirect_uri'] != $redirect_uri) && !in_array($redirect_uri, explode(' ', $application['redirect_uri']))) {
// The redirect_uri could contain several URI that are separated by spaces or new lines.
$uris = explode(' ', str_replace(["\n", "\r", "\t"], ' ', $application['redirect_uri']));
if (!in_array($redirect_uri, $uris)) {
Logger::warning('Redirection uri does not match', ['redirect_uri' => $redirect_uri, 'application-redirect_uri' => $application['redirect_uri']]);
return [];
}