Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDN Domain wird nicht erkannt #2239

Closed
Babelfisch opened this issue Sep 5, 2020 · 5 comments · Fixed by #2362
Closed

IDN Domain wird nicht erkannt #2239

Babelfisch opened this issue Sep 5, 2020 · 5 comments · Fixed by #2362
Labels
Milestone

Comments

@Babelfisch
Copy link

Contao 4.9.5

Lege ich einen neuen Startpunkt einer Webseite an und trage die IDN-Domain www.übungsgrammatik.de als Domainnamen ein, steht nach dem Speichern nur noch www. im Textfeld drin. Entsprechend kann der Startpunkt nicht aufgerufen werden.

Trage ich nur übungsgrammatik.de für den Domainnamen ein, bleibt die Domain korrekt im Textfeld stehen. Allerdings bekomme ich beim Aufruf der Webseite dann „Es ist ein Fehler aufgetreten“ und im Log steht folgende Fehlermeldung:

request.CRITICAL: Uncaught PHP Exception LogicException: "Cannot use UTF-8 route patterns without setting the "utf8" option for route "/"." at /var/www/…/web/vendor/symfony/routing/RouteCompiler.php line 114 {"exception":"[object] (LogicException(code: 0): Cannot use UTF-8 route patterns without setting the \"utf8\" option for route \"/\". at /var/www/…/web/vendor/symfony/routing/RouteCompiler.php:114)"} []

Es funktioniert nur korrekt, wenn ich die Domain in der Punycode-Entsprechung eintrage.

@fritzmg
Copy link
Contributor

fritzmg commented Sep 5, 2020

May be the url rgxp should also automatically use Idna::encode and Idna::decode? The email rgxp does the same (although it does not decode).

@aschempp
Copy link
Member

aschempp commented Sep 5, 2020

Does it work in Contao 4.4?

@leofeyer
Copy link
Member

I can confirm the issue. The hostname is cut at the first UTF-8 character.

@leofeyer leofeyer added the bug label Sep 25, 2020
@leofeyer leofeyer added this to the 4.9 milestone Sep 25, 2020
@leofeyer
Copy link
Member

leofeyer commented Sep 25, 2020

And if I manually add the hostname in the DB, Symfony throws the following exception:

So we should definitely store the hostname in Punycode format in the DB.

@ausi
Copy link
Member

ausi commented Sep 25, 2020

May be the url rgxp should also automatically use Idna::encode and Idna::decode?

I think the url rgxp is not only meant for domain names, right?

We should problably just use Idna::decode in the save_callback of the dns field.

@leofeyer leofeyer linked a pull request Sep 25, 2020 that will close this issue
leofeyer added a commit that referenced this issue Sep 25, 2020
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes #2335, #2239
| Docs PR or issue | -

Commits
-------

a98f75a Correctly handle IDNA hostnames in the root page
b2cd754 CS
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants