Make WordPress Core

Opened 14 years ago

Closed 3 years ago

#17397 closed defect (bug) (maybelater)

Inconsistency in allowed site addresses

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Networks and Sites Keywords: needs-patch dev-feedback
Focuses: multisite Cc:

Description

The rules for allowed characters in a site address differ between when you add a new site and when you edit an existing site.

Steps to reproduce:

  1. Go to Network Admin -> Sites -> Add New
  2. Enter foo.bar as the site address and hit save. The address will be rejected as containing invalid characters.
  3. Edit an existing site instead, and enter foo.bar.yourdomain.com as the domain. The address will be accepted just fine.

Having written that out, maybe this isn't a valid bug because when adding a site you're entering the site address, but when you're editing a site you're editing the complete domain name. Hmm. I'll open it anyway and see what people think.

My core issue is that I'd like to be able to add sites that use fourth-level subdomains (eg foo.bar.baz.com when the main site is at baz.com). Currently I have to enter a different site address then go in and edit it to the desired domain.

Attachments (1)

17397.diff (622 bytes) - added by tlovett1 11 years ago.
Remove domain checks in network/site-new.php

Download all attachments as: .zip

Change History (21)

#1 @johnbillion
13 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Gonna close this as a dupe of #17948 where this issue is covered and being worked on by wpdavis.

#2 follow-up: @SergeyBiryukov
13 years ago

Is it actually covered by that ticket? Overhaul of the signup process sounds like a different thing to me.

#3 @johnbillion
13 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

#4 in reply to: ↑ 2 @johnbillion
13 years ago

Replying to SergeyBiryukov:

Is it actually covered by that ticket? Overhaul of the signup process sounds like a different thing to me.

Whoops. I read this comment which covers username restrictions while I was thinking about site name restrictions.

#5 @wpmuguru
12 years ago

  • Keywords needs-patch added; 2nd-opinion removed

There is a legitimate use case for Super admins adding subdomains with one or more '.' as long as they are not two together.

#6 @Ipstenu
11 years ago

Do we want non super admins doing this, though? Yes, it's a pain to do it the way we have to (i.e. add foo1bar and change it to foo.bar) but is this a bad restriction? A super admin would (should) know if that's going to work as desired anyway.

Since the capes can do this, I'm leaning towards #wontfix or perhaps a better error 'That is an invalid name. Only superadmins can create sub-sub domains.'

(Possible dupe of #20019 - where in I think nacin's suggestion of making this a filter would be aces)

Last edited 11 years ago by Ipstenu (previous) (diff)

@tlovett1
11 years ago

Remove domain checks in network/site-new.php

#7 @tlovett1
11 years ago

Ticket #20019 is regarding frontend signups. This ticket is regarding super admins creating/editing sites. The same rules should apply to super admins when creating/editing sites. There are no restrictions on site addresses in the editing process, but there are during creation. My patch removes the restrictions on domain during site creation.

#8 @tlovett1
11 years ago

  • Cc admin@… added
  • Keywords has-patch added; needs-patch removed

#9 @SergeyBiryukov
11 years ago

Introduced in [13630] (for #11777). Related: [18473] (for #15554).

#10 @jeremyfelt
11 years ago

  • Milestone changed from Awaiting Review to 3.7

#11 @SergeyBiryukov
11 years ago

  • Version changed from 3.1 to 3.0

#12 @jeremyfelt
11 years ago

  • Severity changed from minor to normal

Right now, updating a site through site-info.php does only strtolower() on the domain before sending it to be updated.

Adding a site through site-new.php restricts it to [a-zA-Z0-9-]. We could cheat a bit and make that [a-zA-Z0-9-.] for now, just to allow for . to be entered on new sites, though we'd still be ignoring a bunch of valid characters for domains.

I think @tlovett1's 17397.diff is likely the right answer here until something like #17948 is used to revamp the experience entirely. It applies cleanly on trunk at the moment.

Last edited 11 years ago by SergeyBiryukov (previous) (diff)

#13 @johnbillion
11 years ago

  • Milestone changed from 3.7 to 3.8

Moving to 3.8 for discussion. We need to decide whether this needs to align with #20019.

#14 @nacin
11 years ago

  • Milestone changed from 3.8 to Future Release

#15 @jeremyfelt
11 years ago

  • Component changed from Multisite to Networks and Sites
  • Focuses multisite added

#16 @jeremyfelt
10 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from Future Release to 4.1

On a revisit... While #17948 is a big effort, it seems more oriented around our Open Network concept. Adding sites through site-new.php is very much a Closed Network operation, IMO.

I'm not sure that we need to change the default validation yet, as allowing multilevel subdomains and paths without being setup for it may not be desirable.

I do think we can at least add a filter in 4.1 to help extend validation. It may even be worth starting to think about validate_site_sub_domain() and validate_site_path() functions that can be used here and in other areas like site-info.php.

Related #19724, #15831, #20019, #13387, and #18777 (effectively the sub-directory sibling of this ticket)

#17 @johnbillion
10 years ago

  • Milestone changed from 4.1 to Future Release

After our multisite chat on Tuesday, this needs a bit more thought (as per the above).

#18 @chriscct7
9 years ago

  • Keywords dev-feedback added

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


8 years ago

#20 @johnbillion
3 years ago

  • Resolution set to maybelater
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.