Opened 17 months ago
Last modified 14 months ago
#20019 new enhancement
wpmu_validate_blog_signup(): Allow '.' and '-' in blog names
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Multisite | Version: | 3.3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | xoodrew@…, steve@… |
Description
Canonical uses Wordpress 3.x multisite as part of voices.canonical.com, for employees who do not have or wish to list their personal blog. The code is stock, except for one patch we maintain, which allows blog names (currently in WP as lowercase alphanumeric only) to also include '.' and '-'. This matches our global username format.
Attached is a patch extending wpmu_validate_blog_signup() to allow '.' and '-', with a tweak for the error text. We have been running the patch for awhile, and have not run across any problems with the rest of the code accepting this.
Attachments (1)
Change History (14)
comment:2
DrewAPicture
— 16 months ago
- Cc xoodrew@… added
comment:4
westi
— 16 months ago
I think dots are a good addition see #15831 but I'm not sure about "-" because we don't support it in usernames.
I think we should add support for "." and ensure we have the filters available for someone to extend the support for both usernames and hostnames to include - or other chars if they want.
comment:5
scribu
— 16 months ago
Making the validation filterable is obviously a good idea, but is there any reason usernames can't contain '-'?
comment:6
follow-up:
↓ 7
Ipstenu
— 16 months ago
Westi, is it okay to have a "." in a blogname for subdomains? That could screw up a host that doesn't permit foo.bar.domain.com (which is why I always thought we didn't permit them in blognames... People can switch between subdomain and subfolder at any time, after all, if they're DB savvy).
comment:7
in reply to:
↑ 6
fo0bar
— 16 months ago
Replying to Ipstenu:
Westi, is it okay to have a "." in a blogname for subdomains? That could screw up a host that doesn't permit foo.bar.domain.com (which is why I always thought we didn't permit them in blognames... People can switch between subdomain and subfolder at any time, after all, if they're DB savvy).
That was the only issue I could think of when upstreaming this. For our case, any default would be fine, at long as there was the ability to override it at the config level.
comment:8
follow-up:
↓ 13
nacin
— 16 months ago
I would like to see a filter here, but I'd rather not see the default changed.
comment:10
bluesplinter
— 15 months ago
- Cc steve@… added
comment:11
SergeyBiryukov
— 14 months ago
Related: #19724
comment:12
ryan
— 14 months ago
- Milestone changed from 3.4 to Future Release
We have several tickets related to this. We need to comprehensively clean this up. Punting to future release. The wpmu_validate_blog_signup filter can be used by plugins to get around this for now.
comment:13
in reply to:
↑ 8
bananastalktome
— 14 months ago
Replying to nacin:
I would like to see a filter here, but I'd rather not see the default changed.
+1 to this suggestion. While the defaults may be somewhat restrictive, this may help the casual admin who just wants to set up WordPress and have a guarantee that it will work than the advanced one who is able and willing to do more tweaking to have things work the way they want. Loosening them can be a task left to a filter (though to be fair, there should be a similar filter added for username check as well).
Patch to allow '.' and '-' in blog names, wpmu_validate_blog_signup()