OAuth: make sure to encode the '+' in query string

The server understands '+' as a space.

Issue #7762
This commit is contained in:
Olivier Goffart 2020-02-25 11:40:51 +01:00
parent aab8ee3e77
commit 4296ebffee
2 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,7 @@
Bugfix: Fixed OAuth2 login of user with `+`
Make sure that the `+` in the user name is properly encoded in the URL
opened by the browser when doing an OAuth2 authentication.
https://github.com/owncloud/client/issues/7762

View File

@ -171,6 +171,7 @@ QUrl OAuth::authorisationLink() const
if (!_expectedUser.isNull())
query.addQueryItem("user", _expectedUser);
QUrl url = Utility::concatUrlPath(_account->url(), QLatin1String("/index.php/apps/oauth2/authorize"), query);
url.setQuery(url.query(QUrl::FullyEncoded).replace('+', QLatin1String("%2B"))); // Issue #7762
return url;
}