• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed IDN name on Firefox - cannot post reply

#1
I am not sure this affects all IDN names or not, but we are running a new site at http://สภากาแฟ.net i.e.
http://xn--12c4db3b2bb9h.net and all Firefox users cannot post any reply.

I have isolated the problem by adding a CNAME and create new URL at http://test.serithai.net that point to the same Xenforo installation, and it works fine on my Firefox while the IDN's URL still not working.

Feel free to try at the specified URLs if you need to.

Edit: I set network.IDN_show_punycode to true in Firefox's about:config and it works.
 
Last edited:

Mike

XenForo developer
Staff member
#3
This feels like a Firefox bug, but I'm not sure.

First, IMO, the browser accessing URLs via JS as their Unicode version seems really unintuitive. There's an implication that this is as per the spec, the other browsers don't follow it. That's not actually the core problem.

The error was actually coming from us sending through window.location.href as a header and FF refusing to encode it because it contained values outside the basic ASCII range. (The docs don't seem to cover that this is supposed to be a byte string.) Of course, this comes from accessing the Unicode URL.

I've managed to work around this by replacing the Unicode URL with the Punycode version in a couple places.
 
#4
This feels like a Firefox bug, but I'm not sure.

First, IMO, the browser accessing URLs via JS as their Unicode version seems really unintuitive. There's an implication that this is as per the spec, the other browsers don't follow it. That's not actually the core problem.

The error was actually coming from us sending through window.location.href as a header and FF refusing to encode it because it contained values outside the basic ASCII range. (The docs don't seem to cover that this is supposed to be a byte string.) Of course, this comes from accessing the Unicode URL.

I've managed to work around this by replacing the Unicode URL with the Punycode version in a couple places.
https://bugzilla.mozilla.org/show_bug.cgi?id=743488

Firefox dev insisted that they got it right by specification, and WebKit got it wrong. I guess we must find some way to survive in their conflict.

If you already finished the workaround, could you probably give me the patch? The issue is blocking me now.
 

Mike

XenForo developer
Staff member
#5
I've attached the patch. The xenforo.js file is normally minified and combined with some others so unfortunately it may not be trivial to apply. (You'll see the unminified file as well; I believe you need to combine it with the jQuery "rollup" file.)
 

Attachments

#6
I've attached the patch. The xenforo.js file is normally minified and combined with some others so unfortunately it may not be trivial to apply. (You'll see the unminified file as well; I believe you need to combine it with the jQuery "rollup" file.)
Thank you very much! It is working now. I don't know how to minify it correctly so I will use /full version for now and wait for the next release. Thanks again for fixing this very quickly.