Description
Description
The current username format check is
Username should contain only alphanumeric, dash ('-'), underscore ('_') and dot ('.') characters.
But I think it should be stricter, maybe
Username should contain only alphanumeric, dash ('-'), underscore ('_') and dot ('.') characters, and cannot begin or end with non-alphanumeric, consecutive non-alphanumerics are also not allowed.
What GitHub does:
Username may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen.
You might think this is a suggestion, not a Bug Report, so let me show you the bug.
- Create a user named
test..test
; - Create a repo with default README.md.
- Edit the file online and click "Commit Changes", not "Create a new branch".
I also think we can find the cause and fix the bug, but why not restrict the username format to avoid it?
Gitea Version
main@9b3e2c545
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Binary file.
Database
PostgreSQL