Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#15554 closed defect (bug) (fixed)

Sites with IDN domains can't be created

Reported by: SergeyBiryukov Owned by: ryan
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.0.1
Component: Network Admin Keywords: has-patch
Focuses: multisite Cc:


When I try to create a new site with any valid IDN domain in Multisite, I get “Missing or invalid site address” error.

I found the line in ms-edit.php from r13630 which causes the problem:

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

What is the purpose of the first check? When I remove it and leave only the second one, the site is added correctly.

Also, is it possible convert a domain name to Punycode automatically from UTF-8?

Attachments (2)

15554.diff (612 bytes) - added by wpmuguru 5 years ago.
diff304-blogo.txt (3.6 KB) - added by qdinar 4 years ago.
make idn working

Download all attachments as: .zip

Change History (19)

#2 @SergeyBiryukov
5 years ago

  • Keywords dev-feedback added

#3 @mdawaffe
5 years ago

  • Milestone changed from Awaiting Review to Future Release

The -- check may be to prevent IDNs, since there's probably some bugs elsewhere. If that's the case, I agree it's not a good long term solution :) Maybe wpmuguru can chime in and provide more info.

Yes, punycode conversion is possible in PHP.

Natively: http://us.php.net/manual/en/ref.intl.idn.php (PHP 5.3+ or PECL)

PEAR: http://pear.php.net/package/Net_IDNA2

#4 @wpmuguru
5 years ago

Prior to writing that patch, I did some research on domain name rules. The resource I found indicated that two - were not allowed together. That might have been out of date & I didn't catch it.

There should be no harm from a WP perspective to remove that -- check. We should also test the blog lookup and verify that it works ok with two or more - together. I'll do a sanity check on that and update the ticket.

#5 @wpmuguru
5 years ago

I didn't do an exhaustive amount of testing, but I didn't have any issues with either a subdomain or subfolder install and a blogname with -- in the middle of it.

rewrites worked
permalinks worked
admin area was fine

Early 3.2?

#6 @SergeyBiryukov
5 years ago

  • Keywords 3.2-early needs-patch added; dev-feedback removed

5 years ago

#7 @wpmuguru
5 years ago

  • Keywords has-patch added; needs-patch removed

#8 @wpmuguru
5 years ago

  • Component changed from Multisite to Network Admin

#9 @wpmuguru
5 years ago

We'd make a few people happy if this one was rolled into 3.2.

#10 @SergeyBiryukov
4 years ago

  • Keywords 3.3-early added; 3.2-early removed

#11 @wpmuguru
4 years ago

The patch is still good.

#12 @SergeyBiryukov
4 years ago

  • Milestone changed from Future Release to 3.3

#13 @ryan
4 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [18473]:

Allow creating sites with IDN domains. Props SergeyBiryukov, wpmuguru. fixes #15554

#14 @qdinar
4 years ago

http://codex.wordpress.org/Version_3.3#Install_Process "Allow creating sites with IDN domains"

this is not true. i cannot register a site (from fresh firefox profile). probably ms-edit.php is not used in user registration by themself.

should be new bug opened or this reopened? (somebody open/reopen yourself or say to me to open/reopen)

#15 @qdinar
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

i will attach differences that i made to make my блогы.рф working , when it was 3.0.4 . i have reinstalled os and wordpress, and idn in the site do not work now.

i reopen this bug (or try, selecting it), because heading and first post and all thread are good for that.

4 years ago

make idn working

#16 @ocean90
4 years ago

  • Keywords 3.3-early removed
  • Resolution set to fixed
  • Status changed from reopened to closed

Since this ticket was marked as fixed for a shipped milestone, please open a new ticket and reference this one.

#17 @qdinar
4 years ago

new ticket: #19724

Note: See TracTickets for help on using tickets.