Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#18952 closed defect (bug) (fixed)

AJAX calls to IDN don't work in IE and Opera

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: nacin's profile nacin
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.2.1
Component: I18N Keywords: has-patch dev-feedback
Focuses: Cc:

Description

In jQuery 1.5+, AJAX requests on sites with IDN domains don't work in IE 8 or 9.

On Edit Post screen, adding a new category results in JS error:

Message: 'parsed.responses' - is null or not an object
Line: 311
Char: 4
Code: 0
URI: http://домен.рф/wp-admin/js/post.dev.js?ver=20110524

On Categories screen, adding a new category silently fails.

According to jaubourg's comment in jQuery bug tracker, the request is considered cross-domain and, since IE doesn't support cross-domain requests, AJAX won't find a suitable transport and bail out. The ticket only refers to IE 8, but I've checked this in IE 9, and it seems to show the same behaviour.

A workaround suggested there is to use unencoded domain name or strip it completely.

Attachments (6)

idn-ajax-workaround.php (499 bytes) - added by SergeyBiryukov 13 years ago.
18952.patch (6.1 KB) - added by SergeyBiryukov 13 years ago.
18952.2.patch (1.5 KB) - added by SergeyBiryukov 13 years ago.
18952.3.patch (5.7 KB) - added by SergeyBiryukov 13 years ago.
18952.4.patch (8.2 KB) - added by SergeyBiryukov 13 years ago.
18952.5.patch (11.0 KB) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (21)

#1 @SergeyBiryukov
13 years ago

Attached a workaround plugin.

#2 @SergeyBiryukov
13 years ago

  • Summary changed from AJAX calls to IDN don't work in IE to AJAX calls to IDN don't work in IE and Opera

Opera 11.51 is also affected.

#3 @SergeyBiryukov
13 years ago

  • Keywords has-patch added

18952.patch and 18952.2.patch are two different attempts to use a relative admin URL for AJAX requests.

#5 @SergeyBiryukov
13 years ago

  • Milestone changed from Awaiting Review to 3.4

#6 @SergeyBiryukov
13 years ago

Well, relative_admin_url() from 18952.patch obviously doesn't need $scheme parameter.

#7 @SergeyBiryukov
13 years ago

  • Component changed from External Libraries to I18N
  • Keywords dev-feedback added

#8 follow-up: @nacin
13 years ago

Perhaps this should be wp_ajax_url() instead of a wrapper, as we probably wouldn't use it elsewhere.

#9 in reply to: ↑ 8 @SergeyBiryukov
13 years ago

Replying to nacin:

Perhaps this should be wp_ajax_url() instead of a wrapper, as we probably wouldn't use it elsewhere.

Thanks, done in 18952.3.patch.

#10 follow-up: @ryan
13 years ago

I was thinking all of the url functions that accept a scheme argument could accept relative and root_relative, or the like. No new function needed unless we want a convenience wrapper or filters with more specific context.

Last edited 13 years ago by ryan (previous) (diff)

#11 in reply to: ↑ 10 @SergeyBiryukov
13 years ago

Replying to ryan:

I was thinking all of the url functions that accept a scheme argument could accept relative and root_relative, or the like.

Makes sense, done in 18952.4.patch. 18952.5.patch also updates PHPDocs.

#12 @nacin
13 years ago

In [19870]:

Introduce 'relative' scheme to return only the paths for home_url, site, admin, network_, and get_ variants. props SergeyBiryukov, see #18952.

#13 @nacin
13 years ago

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

In [19871]:

Use relative paths for admin-ajax.php to avoid cross-domain issues with IDN domains in IE and Opera. props SergeyBiryukov, fixes #18952.

#14 @nacin
13 years ago

In [20188]:

URL to admin-ajax.php should be relative. see #19910. see #18952.

#15 @nacin
13 years ago

In [20191]:

Use ajaxurl rather than direct references to admin-ajax.php. see #18952.

Note: See TracTickets for help on using tickets.