calendar icon indicating copy to clipboard operation
calendar copied to clipboard

Problem with Firefox and PunyCode/IDN domain names (with, e.g., ä/ö/ü)

Open EriqJB opened this issue 8 years ago • 11 comments

Steps to reproduce

  1. Install OwnCloud 9.0.1 under an URL with non-ASCII characters (e.g., an IDN domain with German umlauts such as ä,ö,ü)
  2. Use Mozilla Firefox 45.0.2
  3. Create a calendar or activate existing calendar in the browser frontend

Expected behaviour

Calendar should be created when pressing "create" Existing calendar should be displayed (coloured dot left of the name should appear and events should be shown).

Actual behaviour

Calendar creation fails, clicking on the "create" button does not give a reaction Clicking on the name of an existing displays the spinner animated gif, but events do not appear Using Chrome as browser, everything works as expected

Server configuration

Operating system: Linux Web server: Apache Database: MySQL PHP version: 7 ownCloud version: (see ownCloud admin page) 9.0.1 Calendar version: (see ownCloud apps page) 1.1 Updated from an older ownCloud or fresh install: Fresh install

Reason

I've researched a bit and I think i can pin it down to js/vendor/davclient.js/lib/client.js: In line 364, a RegEx is used to match the URL. It is limited to ASCII characters. Obviously, the Chrome JavaScript engine replaces the URL with the PunyCode version, and Firefox does not. Thus, parsing the RegEx fails, the variable "parts" is null and the described behaviour occurs.

I am no JavaScript expert, but this may be a misbehaviour of Firefox JavaScript engine.

EriqJB avatar Apr 20 '16 13:04 EriqJB

Hello, Very interesting diagnostic ! I have the same behavior (cf issue #477) and OC is indeed installed under a IDN domain. And if this issue is related to IDN, this explains why it hasn't been reported by more people. Well done.

alpaclea avatar Apr 20 '16 18:04 alpaclea

@EriqJB Does the files app work just fine?

georgehrke avatar Apr 24 '16 07:04 georgehrke

ping @EriqJB What's about the Files and the Contacts app? :)

georgehrke avatar May 12 '16 19:05 georgehrke

also @alpaclea ^

georgehrke avatar May 12 '16 19:05 georgehrke

Hello, The files app works ok. I don't use the contacts app. I can test though. Still, the bug with non-ascii characters is confirmed for me. and substituting [A-zÀ-ÿ] to [A-z] in the file /var/www/owncloud/apps/calendar/js/vendor/davclient.js/lib/client.js works for me . There must be better ways, sure ! var parts = url.match(/^(?:([A-zÀ-ÿ]+):)?(\/{0,3})([0-9.\-A-zÀ-ÿ]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/);

Regards.

alpaclea avatar May 12 '16 20:05 alpaclea

Hello, For anyone else suffering from this problem, there is another workaround beside using some other browser: setting the network.IDN_show_punycode configuration value under about:config to true apparently solves the issues. This comes at the cost of having the somewhat "ugly" punycode (domain names starting with xn--) shown in the address bar instead of the "nice" unicode domain name.

This workaround also solved a similar problem in Thunderbird for me.

Caralluin avatar May 25 '16 21:05 Caralluin

I have the same issue with an IDN domain. Is there a ETA for a fix already?

Ascendor avatar Jul 23 '16 09:07 Ascendor

@PVince81 Do you do smth special in the files app to prevent this?

georgehrke avatar Jul 23 '16 18:07 georgehrke

@georgehrke there is no special logic for this in the files app

PVince81 avatar Aug 08 '16 07:08 PVince81

Any chance of this getting fixed?

Ascendor avatar Sep 27 '16 16:09 Ascendor

How about using https://github.com/bestiejs/punycode.js to convert the url before processing?

Ascendor avatar Apr 20 '17 12:04 Ascendor