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

Avatars for Unicode usernames #1642

Merged
merged 1 commit into from
Dec 11, 2015

Conversation

fduraibi
Copy link
Contributor

When a new avatar is saved the user name gets encoded using encodeURIComponent, this does not affect names in latin characters, however it does change non-latin/unicode names to an encoded string.

However, when reading the avatar image file, the function uses the username directly without enocinding it, so latin names work since the encoding doesn't change anything, however, Unicode names don't since the usernames don't match the encoded names.

This fix adds the encoding function when reading the avatars.
Also adds the encoding to the function that writes avatars from URL.

When a new avatar is saved the user name gets encoded using `encodeURIComponent`, this does not affect names in latin characters, however it does change non-latin/unicode names to an encoded string.

However, when reading the avatar image file, the function uses the username directly without enocinding it, so latin names work since the encoding doesn't change anything, however, Unicode names don't since the usernames don't match the encoded names.

This fix adds the encoding function when reading the avatars.
Also adds the encoding to the function that writes avatars from URL.
engelgabriel added a commit that referenced this pull request Dec 11, 2015
@engelgabriel engelgabriel merged commit 0d04894 into RocketChat:develop Dec 11, 2015
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