Fix uppercase and Unicode username handling #2160
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here goes another attempt at getting #2138 merged.
This pull request differs from the previous one by
having less messy commits andbetter improving how the filename is determined at the line 195 ofUser.php
. According to my research, this is still needed because of the login plugin not making the username lowercase on registration, while according to my tests on Arch Linux, no duplicate files get created as$file->filename()
gets called on a$file
that was already named, as long as that file hasn't been saved with the wrong name, which should never be the case there.Nevertheless, I shall soon be sending a pull request to the login plugin as well, making it properly convert the usernames to lowercase for filenames. If there is still an important reason to omit the line 195 change that I haven't noticed, that change can perhaps be omitted by somehow lining up a version of the login plugin that would have said pull request merged with a Grav version with the functional rest of this.
Less controversially, this pull request also adds a
mb_strtolower()
call inUser::remove()
.