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

Counting of emojis as special characters #141

Open
phil-davis opened this issue Sep 27, 2018 · 2 comments
Open

Counting of emojis as special characters #141

phil-davis opened this issue Sep 27, 2018 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@phil-davis
Copy link
Contributor

  1. enable the special characters password policy, and set it to 10
  2. enable "Restrict to these special characters" and put an emoji, e.g. 😀 in the special characters list.
  3. add a user, change their password... giving only 2 😀😀 in the password - you get an error message, good.
  4. add a user, change their password... giving 3 😀😀😀 in the password. The password is saved.

It seems that the smiley emoji counts as 4 characters, and 3 of them is enough to exceed the 12 special characters requirement.

I guess that this will apply to other Unicode characters whose storage is greater than 1 byte. Probably the special characters is counting bytes of special character, rather the number of "functional" characters.

Firstly, what is the actual reasonable requirement here, if people put Unicode characters in this special characters field?

@phil-davis
Copy link
Contributor Author

phil-davis commented Sep 27, 2018

I tried with the Devanagari Nepali character न - 3 of those are not enough, 4 of those gets to the 10 character limit. So I guess that Unicode character is 3 bytes long.
Somebody might actually do this sort of thing in India or Russia (Cyrillic) or...

@phil-davis phil-davis changed the title Cunting of emojis as special characters Counting of emojis as special characters Sep 27, 2018
@PVince81
Copy link
Contributor

@settermjd do you know if there are any best practices in such cases ?

technically we could replace strlen and find another PHP function that counts the actual chars

@PVince81 PVince81 added the enhancement New feature or request label Sep 28, 2018
@PVince81 PVince81 added this to the backlog milestone Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants