teppo Posted June 9, 2012 Share Posted June 9, 2012 Not really sure if this is just how it's supposed to work, but currently URL field doesn't allow standard mailto links. This is somewhat annoying, since more often than not we want to allow those while still making sure that the URL is valid (thus using URL field and not just simple text field.) I know it's possible to bypass this by typing "mailto://", but a ) that's non-standard and b ) that's not something a typical user would try.. instead they keep asking me what to do Is there any way this could be implemented in URL field -- or if this is a feature of sanitizer, could that rather be updated to recognize mailto links as standard URLs, or would that cause problems elsewhere? Link to comment Share on other sites More sharing options...
apeisa Posted June 9, 2012 Share Posted June 9, 2012 Wouldn't it be better to build email fieldtype? Or do you have fields where value might be url or email? Link to comment Share on other sites More sharing options...
teppo Posted June 9, 2012 Author Share Posted June 9, 2012 @apeisa, typical use for us would be a repeater with one URL field which could contain any kind of link -- helpmenu, highlights, etc.. you know what I'm talking about here. Of course this could be achieved with two fields instead of one, but I'd rather have only one for simplicity. Also: mailto is valid URI scheme and "mailto:example@example.com" is valid URL, so I'd consider it a bit strange for the URL field not to support it. Perhaps I'm just being too strict here, but that's how I see this Link to comment Share on other sites More sharing options...
netcarver Posted June 9, 2012 Share Posted June 9, 2012 Hi teppo, Perhaps I'm misunderstanding your point but if I am, then what I've misunderstood is scaring me a little :-. There are many more URI schemes in use than just mailto. Some of them are also very useful in allowing contact-type details/locations to be used (like fax, callto, tel, sip, geo, sms and webcal.) Are you suggesting making this field a truly generic URI entry field that allows all of the above and the likes of file, data, snmp & javascript? All of the schemes mentioned here are either already accepted as official URI schemes or are common but unofficial. Link to comment Share on other sites More sharing options...
teppo Posted June 9, 2012 Author Share Posted June 9, 2012 @netcarver, I'm not talking about generic URI field, I'm talking about generic URL field (like it's name already suggests.) Mailto is among many URIs, but it's also an URL -- and a very widely used one too. I'm having some trouble understanding why field titled "URL" wouldn't support a (very) common URL scheme, that's all. There are many situations where you'd want to disallow mailto links (such as when looking for HTTP URLs), but also many situations where you'd want to allow them. The way URL field currently works seems to be that it allows _any_ real or imaginary protocol, as long as they conform to certain syntax. It had no problems with "htpsss", for an example. Just to make things clear, what I'm suggesting here is only adding support for standard "mailto:" syntax.. and to be honest I don't see that as a huge change, since nonstandard "mailto://" is already supported and thus URL field already is pretty generic Link to comment Share on other sites More sharing options...
ryan Posted June 11, 2012 Share Posted June 11, 2012 Right now the field is basically following the rules of PHP's URL filter. I can experiment more with this to see about adding mailto. It does make sense as a possible configuration option as there are many places where you might want to use mailto where you'd also use a URL. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now