WordPress.org

Make WordPress Core

Opened 16 months ago

Last modified 14 months ago

#20019 new enhancement

wpmu_validate_blog_signup(): Allow '.' and '-' in blog names

Reported by: fo0bar 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)

wp-ms-dotdash.patch (706 bytes) - added by fo0bar 16 months ago.
Patch to allow '.' and '-' in blog names, wpmu_validate_blog_signup()

Download all attachments as: .zip

Change History (14)

fo0bar16 months ago

Patch to allow '.' and '-' in blog names, wpmu_validate_blog_signup()

comment:1 scribu16 months ago

  • Milestone changed from Awaiting Review to 3.4

+1

comment:2 DrewAPicture16 months ago

  • Cc xoodrew@… added

comment:4 westi16 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 scribu16 months ago

Making the validation filterable is obviously a good idea, but is there any reason usernames can't contain '-'?

comment:6 follow-up: Ipstenu16 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 fo0bar16 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: nacin16 months ago

I would like to see a filter here, but I'd rather not see the default changed.

comment:9 scribu16 months ago

Related: #20176

Last edited 16 months ago by scribu (previous) (diff)

comment:10 bluesplinter15 months ago

  • Cc steve@… added

comment:12 ryan14 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 bananastalktome14 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).

Note: See TracTickets for help on using tickets.