getkirby-v2/toolkit

url::unIdn(): idn_to_ascii() may return false

shimikano opened this issue · 1 comments

Hello

I ran into an issue with Kirby's go(...) function for redirects on one specific hoster and tracked it down to idn_to_ascii() returning false for any URL given, possibly due to this PHP bug.

As per documentation, idn_to_ascii() may return false on any kind of failure.

So, to make url::unIdn() more robust, I suggest guarding against this case.

Thank you.

While we're at it, the same goes for idn_to_utf8() used in url::idn().