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

Fix listing users in groups with slash in the name #18462

Merged
merged 1 commit into from
Dec 18, 2019

Conversation

gary-kim
Copy link
Member

Still had the groups with / in the name from working on #18228 and noticed while messing with the users list that listing groups with / in the name also causes an error.
This should fix that.

Signed-off-by: Gary Kim <gary@garykim.dev>
@gary-kim gary-kim added the 3. to review Waiting for reviews label Dec 18, 2019
@gary-kim gary-kim added this to the Nextcloud 18 milestone Dec 18, 2019
@gary-kim gary-kim added the bug label Dec 18, 2019
@@ -205,7 +205,7 @@ const actions = {
search = typeof search === 'string' ? search : ''
group = typeof group === 'string' ? group : ''
if (group !== '') {
return api.get(OC.linkToOCS(`cloud/groups/${group}/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2))
return api.get(OC.linkToOCS(`cloud/groups/${encodeURIComponent(group)}/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2))
Copy link
Member

Choose a reason for hiding this comment

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

on a related note: shouldn't we also encode search?

Copy link
Member Author

Choose a reason for hiding this comment

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

It may be a good idea. For now, I believe the allowed characters in usernames means you shouldn't have a username with a character that needs to be encoded. I'll take a look when I've got a moment.

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Makes sense! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants