Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I need to use an email address as the default value of a hidden input field in a form. I also need to have a visible email address on the same page and so have SpamSpan activated on the page. However there seems to be a problem dealing with the hidden input field - it gets partially displayed.
Is there any way I can supress the operation of SpamSpan on one email address in a node (the one in the hidden input field) and yet have it operate on the one that is meant to be displayed?
Comment | File | Size | Author |
---|---|---|---|
#3 | twin_email_showing.png | 33.37 KB | jennypanighetti |
Comments
Comment #1
peterx CreditAttribution: peterx commentedEmail addresses can be of the form
Jill Brown<Jill.Brown@example.com>
. The Spamspan code mentioned something about not handling email addresses in that format. You might be able to use addresses in that format for the addresses you do not want processed and use the simplerJill.Brown@example.com
for the ones you want processed.Comment #2
peterx CreditAttribution: peterx commented1/ Test the Email Field module.
or
2/ Provide more details so I can reproduce the problem.
When you have multiple email addresses connected to a node, the Email Field module might be a better solution. Add two email addresses to the content type. Tell the Email Field module to connect one of the fields to Spamspan.
Spamspan has no way to identify the difference between two addresses in the same text unless you change the format of the email address in some way to make Spamspan not recognise an email address. I mentioned the format with <.
You could write your email in a different format, perhaps replace @ with *, then write a Spamspan style filter to convert the * back to a @ after Spamspan processes the text.
Comment #3
jennypanighetti CreditAttribution: jennypanighetti commentedThis is definitely still an issue, in SpamSpan 7.x-1.2.
I have a Full HTML node with hand-created HTML code including an input field, type hidden, with an email address in the value.
I attempted to rewrite the email address as above, with a name and < characters. It's still partially displayed.
Comment #4
vitalie CreditAttribution: vitalie commented@jenstechs, the question is do you want to obfuscate the hidden email or not?
If not, you can proceed as follows:
* create a new text input format, e.g. Full HTML (no Spamspan) - this will be same as Full HMTL, but without Spamspan
* use that for your node with the hidden email
If yes, then it would be best for you to obfuscate it yourself, since whatever that form is posting to would need to "unobfuscate" anyway, even if you use Spamspan. In other words:
<input type="hidden" value="my-key-for-the-email">
where whatever application you are sending to will replace my-key-for-the-email with twin...
I am leaving the status to Active for now, but this issue will very likely be "Closed (won't fix)"
Comment #5
jennypanighetti CreditAttribution: jennypanighetti commentedThanks for the answer - a new input type was my workaround too.
I don't mind the email address being obfuscated, but it doesn't work with Spamspan. The other problem is if the user wants other email addresses on that same page to be obfuscated. Would there be a way to filter out any
<input>
fields and just leave those?It's okay if this is "Won't Fix" but can it be noted somewhere in docs? Thanks!
Comment #6
Shreya Shetty CreditAttribution: Shreya Shetty commented