php-linkify icon indicating copy to clipboard operation
php-linkify copied to clipboard

Support for URLs without both http and www (just base domains)

Open hi2u opened this issue 8 years ago • 3 comments

The library detects "www.example.com", but not "example.com"

Obviously we're getting close to the area of false positives here, but I think this can be countered by using a whitelist of top-level domains...

http://data.iana.org/TLD/tlds-alpha-by-domain.txt

The options for how this could be implemented are:

  • Option1: Hardcode the latest whitelist into each release of Linkify
  • Option2: Have the user's application manage/source the whitelist of TLDs, then pass them into Linkify
  • Option3: Option1 baked in by default, with the option for Option2

Seeing this is a small library that doesn't need regular releases anyway, option Option1 might be overkill here. And Option2 allows us to ensure they we're always using an up-to-date whitelist.

hi2u avatar Feb 21 '17 01:02 hi2u

+1

kolinko-ant avatar Nov 28 '17 09:11 kolinko-ant

+1

Yahav avatar Apr 07 '18 17:04 Yahav

+1

nathan005 avatar Jun 24 '20 17:06 nathan005