I noticed a user had entered their email address for their website. I proceeded to try and enter mine and it worked no problem.

This should not happen.

Comments

jcfiala’s picture

Status: Active » Closed (works as designed)

Incorrect - an email address is a perfectly reasonable link target. mailto:john@example.com is as valid as http://www.example.com, after all.

elijah lynn’s picture

The link that shows up is http://www.example.com/user@drupal.org

When clicked it gives a 404.

Is this correct?

darktygur-1’s picture

Status: Closed (works as designed) » Active

Something still isn't right. I just looked at the source code. This module is allowing emails (I'm talking about email addresses, not mailto: url's) to pass through validation, and then saving them as though they're url's. Later, it passes all url's through Drupal's url() function before they end up in the href attribute of A tags. The problem is that an email address (without mailto:) is not a url (at least, not one that links to an email address in the context of a page). To Drupal's url() function, it looks like a link to a page that happens to have a @ character in its path.

Patroclas’s picture

I agree with #3 - I have a link field in a form and some users try to enter an email address. It creates a useless link.

It would be really useful to be able to prevent this through validation.

jpeterson’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

I was running into similar parsing issues with email addresses not always being detected as such, as well as users who were confused by having to enter "mailto:" first.

The attached patch changes the email address detection from custom regexs inside the link module, to using drupal core's valid_email_address. This seems to fix some of the detection problems. Then, f needed, in sanitize, it automatically adds mailto: for urls which are of type LINK_EMAIL (much like http:// is automatically added for urls that appear to be referencing a root domain).

dqd’s picture

Status: Needs review » Closed (works as designed)

please create a new issue if the problem persist. This issue is 2 years old and we are @ 6.x-2.9