Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView: Properly handle usernames with spaces and plus signs in it #1273

Merged
merged 1 commit into from
May 23, 2019

Conversation

csware
Copy link
Contributor

@csware csware commented May 23, 2019

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 9ec61a8). 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)

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot.

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 nextcloud#279 resp. commit 9ec61a8). 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 nextcloud#1266)

Signed-off-by: Sven Strickroth <[email protected]>
@rullzer rullzer merged commit ea6f3be into nextcloud:master May 23, 2019
@csware csware deleted the issue-1266 branch May 23, 2019 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants