Closed mzurawek closed 2 years ago
@mzurawek thanks for using the library.
The host you are trying to verify is invalid against DNS host the label is too long there's a limit of 63 characters and I won't even mention your use of UTF-8 characters in there.
Do remember that parse_url
is only a parser it does not validate the return value which means that parse_url
can sometimes like in your case return falsy responses.
If the host information is of high importance in your system I would strongly suggest using a proper URI validator tools and after validating the full URI use the current package.
To me this is not a bug from the package but rather in parse_url
at least as far as I can see and reproduce the issue. Maybe you should raise it as an error on PHP bugs channel 🤔
Thank you for suggestion. I've switched from parse_url to league/uri-parser package and it catches that exception.
Example code:
Rules::fromString($listContent)->getICANNDomain($host)
throwsSince PHP 8.1.7 parse_url returns this as a valid host I would expect php-domain-parser to somehow signal it cannot process this host. Or am I doing something wrong?