Posted by mglanznig on February 14, 2007 at 9:42pm
| Project: | Email Field |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
I created a patch to add support for the SpamSpan module (email obfuscator). The patch is created against 5.x-1.x-dev. Attention: The SpamSpan module has to be patched in order for this patch to work! See the corresponding issue there.
| Attachment | Size |
|---|---|
| email_1.patch | 2.54 KB |
Comments
#1
typo. sorry.
#2
Hi!
Thanks for your patch! Looks clean and this is certainly a great additional feature for the email module, but I'll wait until the SpamSpam module has applied the patch, then I'll integrate a SpamSpam formatter.
#3
I applied both patches and I am still not seeing obfuscation in CCK email fields. I do see obfuscation in regular nodes in which an email address appears (except when the user has entered mailto tags).
#4
When you create an email field you should see at "Email Link Type": Mailto: Direct link with SpamSpan encryption (only if you have the SpamSpan module installed). You have to mark this radio button. If you are not seeing this option and have the SpamSpan module installed, then maybe the new dev version of email-field has changed its behaviour. I will look into this.
#5
Thanks - since this was a field I had created prior to installing SpamSpan, I hadn't seen this option. I also had to go to the "Display Fields" tab and choose "Email-SpamSpan" under Teaser and Full, otherwise the email field was completely hidden.
It is all working correctly now, and I and my users thank you! Just a word of warning, though: users who enter email addresses already surrounded by "mailto" tags (e.g. if TinyMCE is installed/enabled and the user copies and pastes a formatted email address from another website or other data source) will find that those email addresses are not obfuscated. I don't know if it's feasible to fix this in the SpamSpan code, but users should be aware of the issue.
#6
I'm glad to hear that. Unfortunately I'm not the maintainer nor a developer of the SpamSpan-Module and I currently have no time to address this issue. I think you should create an issue with your findings in the SpamSpan-Issue queue. Maybe some other developer can fix this.
#7
Hello,
There is a typo in patch :
'mailto_encrypt_inivismail'
Works well. How to encrypt email addresses in views ?
Frederic
#8
I have found for email address in lists.
#9
Corrected. Thanks for your hint. There are so many 'i's in the name invisimail that it's easy to forget one. :-)
#10
I just wrote some lines of code for integrate the email cck field with spamspan, and then I found this isssue...
However, my patch should work with the Spamspan current version (no more patch needed). So maybe someone could be interested on it...
#11
Here is the patch...
#12
I'm afraid the patch email.module_1.patch don't work as expected. The problem is here, if I'm not mistaken:
$mailto = '<a href="mailto:'. $item['email']. '">'. check_plain($item['email']) .'</a>';if (($field['widget']['link_type'] == 'mailto_spamspan' || $formatter == 'spamspan') && module_exists('spamspan')) {
$mailto = spamspan($mailto, 1);
}
Here the spamspan function is not called with the plain email address as expected but with the email link including the anchor mailto: etc.
Attached is a patch where the code above is in format:
elseif (($field['widget']['link_type'] == 'mailto_spamspan' || $formatter == 'spamspan') && module_exists('spamspan')) {$mailto = spamspan(check_plain($item['email']), 1);
}
else {
$mailto = '<a href="mailto:'. $item['email']. '">'. check_plain($item['email']) .'</a>';
}
#13