Ticket #363 (closed task: invalid)

Opened 2 years ago

Last modified 2 years ago

add capability to create blog/usernames with hyphens (minus sign '-' char)

Reported by: radja Assigned to: somebody
Priority: normal Milestone:
Component: component1 Version:
Severity: normal Keywords: blogname, username, hyphen, dash
Cc: options

Description

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.

Change History

(follow-up: ↓ 3 ) 06/25/07 10:20:11 changed by donncha

  • status changed from new to closed.
  • resolution set to wontfix.

The "_" character isn't allowed in hostnames, so that's never going in. Use Google and you'll find an RFC on it. The '.' character is used to separate out parts of a FQDN, so again, that's a no go. Finally, we don't allow '-' because it's not recommended in URLs. It's much easier to tell someone to go to myfabulousblog.wordpress.com rather than "my dash fabulous dash blog.wordpress.com"

06/25/07 18:14:17 changed by drmike

I went and found it. It's RFC 952 in case anyone is interested.

http://www.faqs.org/rfcs/rfc952.html

(in reply to: ↑ 1 ) 10/25/07 21:45:12 changed by options

  • status changed from closed to reopened.
  • cc set to options.
  • type changed from enhancement to task.
  • summary changed from add possibility to create blognames or usernames with "-", "." and "_" characters to add capability to create blog/usernames with hyphens (minus sign '-' char).
  • milestone deleted.
  • keywords changed from blogname,username to blogname, username, hyphen, dash.
  • resolution deleted.

Replying to donncha:


Finally, we don't allow '-' because it's not recommended in URLs.


I'd love just to peek at such recomendations (and their authors as well).

even the RFC952*, that drimke referred to, explicitly states that hypens (munus sign '-') are allowed in the hostnames.


It's much easier to tell someone to go to myfabulousblog.wordpress.com rather than "my dash fabulous dash blog.wordpress.com"


why MU users (in general, and .com ones in particular) ain't allowed to decide how to spell their blognames 'easier' for themselves?


*) RFC1034 says:

The labels must follow the rules for ARPANET host names. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen.

There are also some restrictions on the length. Labels must be 63 characters or less.

10/26/07 15:02:31 changed by donncha

  • status changed from reopened to closed.
  • resolution set to invalid.

I'll just copy and paste what I wrote above then:

It's much easier to tell someone to go to myfabulousblog.wordpress.com rather than "my dash fabulous dash blog.wordpress.com"

I see you missed out on o-p-t-i-o-n-s.com but it looks like o-p-t-i-o-n-s.org is still available!