-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow capitalized usernames if the regex agrees #2138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filenames are case insensitive in most systems and removing strtolower()
will just mess up things and cause issues especially if you have Win/Mac development system and Linux server.
Right, completely forgot about this limitation, I apologize. Still, the way this currently is implemented, Grav noticeably lowers its chances of being used in any sort of social platform, except possibly one about retro computing, limiting its usage to great-looking, high-performance blogs. Due to that, I believe this should still be somehow fixed. The best implementation I can spontaneously think of is to prepend the usernames with the character case masks, in an optimal number system, i.e. Due to that, I request that this pull request stays open for now, with higher quality commits hopefully appearing soon. |
I would just have field username inside the yaml, which overrides the one in filename if set. |
This may help to get started: https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/User/User.php#L206 |
Also adds support for Unicode in the usernames, and patches a nasty bug where the usernames don't get saved lowercase.
Please review it again. Note that the bug about usernames not getting saved lowercase has been patched by removing the Thanks! |
Whoops, forgot about that one (and totally haven't woken up suddenly realizing this), here we go, hopefully. |
Looks much better now. The only thing which I don't like is to remove the filename check as it causes filename to potentially change after every save thus causing the user to duplicate. |
Closed due to |
I don't know the exact motivation behind these uses of
strtolower
, but I believe that the existence of the username regular expression in Grav's config clearly implies that the usernames don't just have to be lowercase, hence this pull request.