The current version of Spamspan doesn't manage the text part in a mailto link. For example, <a href="user@example.com">John Doe</a>is rendered as user [at] example [dot] com, and the real name is lost: js, if active, convert back the link to <a href="user@example.com">user@example.com</a>.

My patch aims to resolve this issue. With it, the module converts the above link as user [at] example [dot] com (John Doe).
Indeed, my version is able to convert mailto links with url parameters (actually, the url parameters are discarded, but the link is converted, while the current version does nothing in such a case).

CommentFileSizeAuthor
#4 spamspan.patch5.04 KBtiziano
spamspan_2.patch5.14 KBtiziano

Comments

lakka’s picture

Assigned: Unassigned » lakka
Status: Active » Needs review
ashtonium’s picture

fixes the issue for me. thanks!

enxox’s picture

Patch cannot be applyed to last .dev version. Should you please provide an update?

Thanks.

tiziano’s picture

StatusFileSize
new5.04 KB

Here is a new patch, for latest dev version.

lakka’s picture

@tiziano - thanks a lot for updating this. It's a great help.

A couple of questions though. I note that you have changed the regexps used, and am wondering why. For example, local parts of email addresses can contain ' and even @ characters (if properly quoted). But your EMAIL_REGEX does not allow them. Also, domain parts are restricted to letters and digits only (separated by dots), but you allow ~, +, _, and = (see eg Wikipedia on e-mail addresses)

I'm interested to know why you have changed the regexps in this way. Is there some particular problem you are trying to solve?

enxox’s picture

Grazie.

tiziano’s picture

@lakka:

I don't remember from where I copied the regexp. However: I think it isn't worth to build a complex regexp to take care about ' and @ in the local part. Even if they are legal characters, I never seen an email address with them included...

About domain parts, I clearly made a mistake, copying the string from above. So the correct regexp should be:
"!([-.~+_=a-z0-9]+)@([.a-z0-9]+\.[a-z]{2,6})!ix".

pancho’s picture

I agree with tiziano in that we shouldn't care about ' and @ chars in the local part. Most if not all email providers don't allow them and nobody would use them to avoid confusion. If there was one single user of this module who needs those two chars, we could think again and possibly switch back. But I doubt that.

Concerning the new functionality introduced by tiziano I'm certainly +1. This is good!

lakka’s picture

Fair point. But it doesn't require much to include them. My original code did. I was just wondering whether tiziano changed it for a specific reason.

Actually, to be fuly RFC compliant, we should use a regexp like this one ;-)

I intend to commit the patch asap, but I have some testing to do first.

Mac Clemmens’s picture

I think this is a worthwhile change to make to the module -- this functionality is essential for my uses. I was actually caught off guard when the script "ate" the names on our staff directory :)

lakka’s picture

Preliminary fix is in cvs on the Drupal 6 branch.

lakka’s picture

Status: Needs review » Closed (fixed)

And now fixed for D6 in 6.x-1.2

new_B’s picture

Thanks lakka for the useful module.

I'm currently experiencing the same issue in 5.x-1.4. Is there a backport available for D5? Does the patch in #4 still apply? Thanks.