calendar
calendar copied to clipboard
Problem with Firefox and PunyCode/IDN domain names (with, e.g., ä/ö/ü)
Steps to reproduce
- Install OwnCloud 9.0.1 under an URL with non-ASCII characters (e.g., an IDN domain with German umlauts such as ä,ö,ü)
- Use Mozilla Firefox 45.0.2
- 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.
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.
@EriqJB Does the files app work just fine?
ping @EriqJB What's about the Files and the Contacts app? :)
also @alpaclea ^
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.
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.
I have the same issue with an IDN domain. Is there a ETA for a fix already?
@PVince81 Do you do smth special in the files app to prevent this?
@georgehrke there is no special logic for this in the files app
Any chance of this getting fixed?
How about using https://github.com/bestiejs/punycode.js to convert the url before processing?