[wpmu-trac] [WordPress MU Trac] #363: add possibility to create
blognames or usernames with "-", "." and "_" characters
WordPress MU Trac
wpmu-trac at lists.automattic.com
Sun Jun 24 22:00:38 GMT 2007
#363: add possibility to create blognames or usernames with "-", "." and "_"
characters
-------------------------+--------------------------------------------------
Reporter: radja | Owner: somebody
Type: enhancement | Status: new
Priority: normal | Milestone: WPMU 2.0
Component: component1 | Version:
Severity: normal | Keywords: blogname,username
-------------------------+--------------------------------------------------
I thing it would be nice to have possibility for users of blogs at WP MU
to able to create blog names and usernames with these characters:
"-", "." and "_". for example: my-blog.domain.com, or my.domain.domain.com
or my_domain.domain.com
this is now not allowed now and I do not know why. From my point of view
(I am new with WP MU) there is no reason why not to allow this.
This would allow bloggers to create nicer URLs of their blogs. As My-
super-blog.domain.com is better readable than Mysuperblog.domain.com. Huh,
what do you think? I have heard some people that wanted the same for their
site...
To enable this is need this simple edit of wp-include/wpmu-function.php
file
on line 1011 (for blogname)
replace:
preg_match( "/[a-zA-Z0-9]+/", $blog_id, $maybe );
with:
preg_match( "/[a-zA-Z0-9\.\-\_]+/", $blog_id, $maybe );
then delete lines:
1022 and 1023:
if ( strpos( " " . $blog_id, "_" ) != false )
$errors->add('blog_id', __("Sorry, blog names may not contain the
character '_'!"));
and line: 910 (for username)
replace:
preg_match( "/[a-zA-Z0-9]+/", $user_name, $maybe );
with:
preg_match( "/[a-zA-Z0-9\.\-\_]+/", $user_name, $maybe );
delete lines 932 and 933:
if ( strpos( " " . $user_name, "_" ) != false )
$errors->add('user_name', __("Sorry, usernames may not contain the
character '_'!"));
and finally these texts should be changed then:
"Only letters and numbers allowed" and mention there that ".", "-" and "_"
are allowed also.
--
Ticket URL: <http://trac.mu.wordpress.org/ticket/363>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser
More information about the wpmu-trac
mailing list