Merge pull request #14499 from annando/issue-14478-2

Issue 14478: Fix OAuth registration with Buffer
This commit is contained in:
Tobias Diekershoff 2024-10-26 07:49:07 +02:00 committed by GitHub
commit 4c3c4bd58d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -129,8 +129,9 @@ class OAuth
return []; return [];
} }
// The redirect_uri could contain several URI that are separated by spaces. // The redirect_uri could contain several URI that are separated by spaces or new lines.
if (($application['redirect_uri'] != $redirect_uri) && !in_array($redirect_uri, explode(' ', $application['redirect_uri']))) { $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']]); Logger::warning('Redirection uri does not match', ['redirect_uri' => $redirect_uri, 'application-redirect_uri' => $application['redirect_uri']]);
return []; return [];
} }