In a discussion with @SuperTux88, we discovered that our validation mechanism for diaspora* IDs is not perfect. In the documentation, there are two additional rules currently not covered by the validator:
The diaspora* ID is at most 255 chars long and it must be lowercase.
I altered the regex so that uppercased usernames and hostnames will fail the validation. This does not change our current behavior in reality, since diaspora* already fails when using uppercase characters.
While working on it, I replaced the letter, digit, and hexadecimal parts with their POSIX character class counterparts. Ultimately, this should make the final expression more readable. Because the parts are named now anyway, I removed the individual variable definitions for them.
In addition, I added a check that fails if the IDs length exceeds 255 characters.
In a discussion with @SuperTux88, we discovered that our validation mechanism for diaspora* IDs is not perfect. In the documentation, there are two additional rules currently not covered by the validator:
I altered the regex so that uppercased usernames and hostnames will fail the validation. This does not change our current behavior in reality, since diaspora* already fails when using uppercase characters.
While working on it, I replaced the
letter
,digit
, andhexadecimal
parts with their POSIX character class counterparts. Ultimately, this should make the final expression more readable. Because the parts are named now anyway, I removed the individual variable definitions for them.In addition, I added a check that fails if the IDs length exceeds 255 characters.