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).
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | spamspan.patch | 5.04 KB | tiziano |
| spamspan_2.patch | 5.14 KB | tiziano |
Comments
Comment #1
lakka commentedComment #2
ashtonium commentedfixes the issue for me. thanks!
Comment #3
enxox commentedPatch cannot be applyed to last .dev version. Should you please provide an update?
Thanks.
Comment #4
tiziano commentedHere is a new patch, for latest dev version.
Comment #5
lakka commented@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?
Comment #6
enxox commentedGrazie.
Comment #7
tiziano commented@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".
Comment #8
panchoI 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!
Comment #9
lakka commentedFair 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.
Comment #10
Mac Clemmens commentedI 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 :)
Comment #11
lakka commentedPreliminary fix is in cvs on the Drupal 6 branch.
Comment #12
lakka commentedAnd now fixed for D6 in 6.x-1.2
Comment #13
new_B commentedThanks 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.