WebView: Properly handle usernames with spaces and plus signs in it
authorSven Strickroth <email@cs-ware.de>
Thu, 23 May 2019 14:44:01 +0000 (16:44 +0200)
committerSven Strickroth <email@cs-ware.de>
Thu, 23 May 2019 15:09:33 +0000 (17:09 +0200)
commit85d217ec9514babeb665dda0ab7b65fe2b0e9b21
tree45ec34c49daba58873671dc5911a7a25b30a50a4
parente8213242a9cde1e1668279d413db8a558ceaa927
WebView: Properly handle usernames with spaces and plus signs in it

The path returned from the server encodes a space in the username with `+` and if the username contains a `+` sign it is encoded as `%2B` (cf. https://www.php.net/manual/function.urlencode.php).

Fix: Don't (double) decode the URL path and then replace `+` with space (introduced in issue #279 resp. commit 9ec61a84ce682399b4c39182887e488c99f1d87a). Instead first replace `+` with space, then decode percent encoding.

Tested with a username containing a space, a username containing a `+`sign and a username containing just A-Za-z0-9- (with Nextcloud 16).

(fixes issue #1266)

Signed-off-by: Sven Strickroth <email@cs-ware.de>
src/gui/wizard/webview.cpp