tables icon indicating copy to clipboard operation
tables copied to clipboard

Bug: Link column allows URL without tld

Open enjeck opened this issue 6 months ago • 1 comments

Ah, another thing though: currently it allows me to safe a value like "https:wikipedia" or "http:hui"

Originally posted by @silverkszlo in https://github.com/nextcloud/tables/pull/1977#discussion_r2281671829

enjeck avatar Aug 18 '25 09:08 enjeck

@enjeck I think the TLD should remain optional, since a valid URL does not necessarily need one. In networks environments it's common to have short hostnames without a TLD or reserved hostnames.

Currently the validation checks if the protocol is either http or https, but these should also require // after the protocol for a valid URL. It does that by extracting the protocol using the javascript URL() constructor.

I suggest to use the same URL() constructor to sanitize the URL input after validating the protocol, so the // would be added automatically.

benjaminfrueh avatar Sep 18 '25 18:09 benjaminfrueh