If there an easy way to stop links like www.myøwn.no being rejected by the valid_url function without encoding them? Surely now we have unicode domains and even TLDs in utf8 it's about time we started accepting urls in utf8?

Comments

Dave Reid’s picture

Title: making valid_url utf8 compliant » valid_url() rejects utf8 URLs
Version: 6.x-dev » 8.x-dev
Category: feature » bug
Issue tags: +Needs backport to D7, +D8MI, +Media Initiative

We encountered this recently with http://edukame.com/wp-content/uploads/2009/02/madre-y-niña-besa-mano.jpg on #1492658: Support URLs with UTF8 characters in media_internet. This is a core bug that needs to be backported as well.

Dave Reid’s picture

Seems that we can't even rely on filter_var($url, FILTER_VALIDATE_URL) in PHP since that also fails as well.

Haza’s picture

We can still use filter_var with FILTER_CALLBACK to write our own filter function.

dawehner’s picture

There is a pecl for that http://php.net/manual/en/function.idn-to-ascii.php which you can run before running filter_var, though this can't be used here.

The standard which has to be implemented is http://www.ietf.org/rfc/rfc3490.txt

sun’s picture

Status: Active » Closed (duplicate)

Thanks for taking the time to report this issue.

However, marking as duplicate of #389278: Create IDN encoding and decoding functions. You may follow that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.

Mixologic’s picture

Issue summary: View changes
Issue tags: +IDN
Related issues: +#389278: Create IDN encoding and decoding functions
Gábor Hojtsy’s picture

Issue tags: -Media Initiative +D8Media