Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#32928 closed enhancement (duplicate)

Multisite: Allow the developer to filter the domain validation regex from /wp-admin/network/site-new.php line #41 (WP 4.2.2)

Reported by: lordspace Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description

I am working on a project that may have sites that are nested within another path for example:
/faculty/
/faculty/sub-site/
/faculty/sub-site2/
etc.

Fix:

$ms_domain_validation_regex = apply_filters( 'ms_domain_validation_regex', '|^([a-zA-Z0-9-])+$|' );

if ( preg_match( $ms_domain_validation_regex, $blog['domain'] ) ) {
	$domain = strtolower( $blog['domain'] );
}

old:

if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
		$domain = strtolower( $blog['domain'] );

Feel free to come up with a better name for the filter.

Related:
https://make.wordpress.org/core/2013/10/06/potential-roadmap-for-multisite/
http://www.paulund.co.uk/wordpress-multisite-nested-paths

Change History (4)

#1 @jeremyfelt
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 4.2.2 deleted

Hi @lordspace, thanks for the ticket! This looks like a duplicate of #18777. I agree that we should be able to do something to make this easier. There are a few places where general domain and path validation should be improved.

#2 @lordspace
7 years ago

ok. hmm, I did a search and 4 results came up.
The existing ticket didn't come up.

#3 follow-up: @orbisius
7 years ago

Does the closed and duplicate status mean that the request won't get implemented?

#4 in reply to: ↑ 3 @DrewAPicture
7 years ago

Replying to orbisius:

Does the closed and duplicate status mean that the request won't get implemented?

It simply means that we're consolidating effort and discussion to a single ticket, in this case #18777.

Note: See TracTickets for help on using tickets.