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

ext-intl actually required..? #25

Closed
tomgidden opened this issue Nov 19, 2019 · 2 comments · Fixed by thephpleague/uri#142
Closed

ext-intl actually required..? #25

tomgidden opened this issue Nov 19, 2019 · 2 comments · Fixed by thephpleague/uri#142
Assignees
Labels
bug Something isn't working

Comments

@tomgidden
Copy link

tomgidden commented Nov 19, 2019

Q A
Version 6.0.0

Question

The documentation for 6.0 includes:

In order to handle IDN host you are required to install the intl extension otherwise an exception will be thrown when attempting to validate or format such host.

This suggests that if the intl extension was not installed (contrary to advice, of course), then it might still work if only non-IDN hosts are used.

However, with a trivial test on PHP 7.2 without intl:

$x = \League\Uri\Uri::createFromString("http://foo.com/");

I get:

PHP Fatal error:  Uncaught Error: Undefined constant 'IDNA_ERROR_EMPTY_LABEL' in …/vendor/league/uri/src/Uri.php:626

Of course, the obvious solution is to install intl, which I will be doing.

So, does the documentation need clarifying to say that intl is required whether IDN hosts are used or not; or should the library be fixed to only fail with a thrown exception if an IDN host is passed (as suggested by the current documentation)?

@nyamsprod
Copy link
Member

I need to check that first but I'd say that

The library should be fixed to only fail with a thrown exception if an IDN host is passed (as suggested by the current documentation)?

Maybe I'm overchecking the host part because checking host can somehow be more difficult than it appears. Thanks for the issue ;)

@nyamsprod
Copy link
Member

@tomgidden the next release will contain the patch

@nyamsprod nyamsprod transferred this issue from thephpleague/uri Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants