WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 months ago

#17397 reopened defect (bug)

Inconsistency in allowed site addresses

Reported by: johnbillion Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.0
Component: Networks and Sites Keywords: has-patch
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 8 months ago.
Remove domain checks in network/site-new.php

Download all attachments as: .zip

Change History (16)

comment:1 johnbillion3 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.

comment:2 follow-up: SergeyBiryukov3 years ago

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

comment:3 johnbillion3 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

comment:4 in reply to: ↑ 2 johnbillion3 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.

comment:5 wpmuguru18 months 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.

comment:6 Ipstenu8 months 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.'

Version 0, edited 8 months ago by Ipstenu (next)

tlovett18 months ago

Remove domain checks in network/site-new.php

comment:7 tlovett18 months 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.

comment:8 tlovett18 months ago

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

comment:9 SergeyBiryukov8 months ago

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

comment:10 jeremyfelt8 months ago

  • Milestone changed from Awaiting Review to 3.7

comment:11 SergeyBiryukov8 months ago

  • Version changed from 3.1 to 3.0

comment:12 jeremyfelt7 months 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 7 months ago by SergeyBiryukov (previous) (diff)

comment:13 johnbillion7 months 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.

comment:14 nacin5 months ago

  • Milestone changed from 3.8 to Future Release

comment:15 jeremyfelt3 months ago

  • Component changed from Multisite to Networks and Sites
  • Focuses multisite added
Note: See TracTickets for help on using tickets.