linkit icon indicating copy to clipboard operation
linkit copied to clipboard

Ease up on URL validation (iTunes store links)

Open engram-design opened this issue 6 years ago • 2 comments

One thing we've noticed is that custom URL fields don't accept certain URLs, if they're a bit unusual. For instance, links to the Apple App Store:

itms-apps://itunes.apple.com/us/app...

Is a valid link, and works, but cannot be saved in a Linkit field.

I would think either turning off URL validation, accepting these sort of links, or being a bit more lenient on URL structures would all be valid options.

Thanks!

engram-design avatar Feb 06 '19 22:02 engram-design

Any update on this? We also have a client looking for this functionality.

Kashkin avatar Jan 05 '20 22:01 Kashkin

I had the same issue a while back.
Ended up making a custom link type (see https://github.com/fruitstudios/craft-linkit#custom-link-types) with the validation rules I needed.

As far as I can see the linkit URL validator is based on yii\validators\UrlValidator which lists http and httpsas valid schemes as default (https://www.yiiframework.com/doc/api/2.0/yii-validators-urlvalidator#$validSchemes-detail).

Not sure if loosen up the validation rules for URL or creating a new link type (applink or something) would be the correct way to go?

nettum avatar Jan 07 '20 15:01 nettum