Hi all,
I really, really wanted underscores in my usernames so I took my
courage in both hands and dug, and thought I would document what I
found for others interested to see.
At register-time, nicknames are Validate'd using:
define('NICKNAME_FMT', VALIDATE_NUM.VALIDATE_ALPHA_LOWER);
so it's pretty straightforward to change that to :
define('NICKNAME_FMT', VALIDATE_NUM.VALIDATE_ALPHA.'_');
However, the router's definition does not include a reference to
NICKNAME_FMT (which I believe it should), so I replaced in the router
every
'nickname' => '[a-zA-Z0-9]{1,64}'
with
'nickname' => '['.NICKNAME_FMT.']{1,64}'
I understand the router allows more than nicknames to account for the
fact that people might type http://identi.ca/JulienC to get to
http://identi.ca/julienc, but I think it would be great to re-use
NICKNAME_FMT there nonetheless.
After these changes, things work pretty fine, except for a few kinks
when the username is Markdown'd ('_' is part of Markdown's syntax).
One example of this is in showstream's showEmptyListMessage() (which I
resolved with an
str_replace('_', '\_', $this->user->nickname)
), but there might be other places where this happens.
Hope this helps somebody,
Julien
_______________________________________________
StatusNet-dev mailing list
[email protected]
http://lists.status.net/mailman/listinfo/statusnet-dev