Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

hiding emails from bots

Go to End

16 Posts   6724 Views


Community Member, 86 Posts

18 September 2007 at 11:15pm

Yeah, it's not that great of a method, but I think the main difference is that while most other places use Javascript code or ASCII equivalent-characters, this one uses a completely different method which requires bots to interpret HTTP headers instead of just brute-forcing a link. Plus, because the link isn't mailto:, it will most likely be skipped by the majority of spam bots (we could change the controller-url to something other than mailto/ as well).


Community Member, 8 Posts

25 April 2008 at 6:44am

why do you implement a simple captcha within the formeditor?

or make a simple howto - so if someone would like to use a captcha - it can be included as simple as can.

i will like to have a captcha, but i don't know how to put it into the form. ;-)


Forum Moderator, 224 Posts

25 April 2008 at 9:53am


Captcha is a pain for users. I think it is better to have an alternative that allows straight input.




Community Member, 31 Posts

25 April 2008 at 8:52pm

I agree with this last point. A good email obfuscator needs to use javascript in my opinion.

I would recommend to have a look to this wonderful article

The only downfall is that you need a backup solution for those who don't have javascript activated.

It wouldn't be too difficult, I guess, to implement this solution into SS.


Administrator, 690 Posts

25 April 2008 at 10:19pm

It's true that Captcha is controversial, but I don't think that we want to block it out of SilverStripe altogether!

This recaptcha field might help:


Community Member, 67 Posts

29 April 2008 at 6:45am

Edited: 29/04/2008 6:47am

Is it possible to decorate a random class like DBField?
That would be useful for this. For example:
1. Install the module reCaptcha-MailHide
2. Update themes like this:

Or, to be a bit more extensible:
1. Install the module spamprotect-reCaptcha (or any spamprotect-* module)
2. Set the preferred anti-spam mechanism in _config.php
3. Update themes like this:
4. Decide that you want a different mechanism
5. Install spamprotect-yourRandomMechanism
6. Update setting in _config.php


EDIT: Of course, $Content.SpamProtected should return the same as $Content if no spamprotect-* module is installed (maybe provide a default one?)


Administrator, 690 Posts

29 April 2008 at 10:02am

I'm not sure about decorating a Varchar; in theory it's possible but I've never done it.

One of the approaches we're thinking about taking with this stuff is to increase the number of DBField subclasses to better describe the kind of content that they contain.

So, you might have

class EmailAddress extends Varchar {



static $db = array(
"Email" => "EmailAddress",


Community Member, 67 Posts

30 April 2008 at 4:43am

Edited: 30/04/2008 4:45am

That's definately a good idea to have an EmailField, but it won't cover the possibility of inlining email adresses in the Content field for example.

Maybe that anti-spam support could be in the core, and then make a class, say AntiSpamifier, that one should subclass to implement new mechanisms?

Relevant classes could then implement a getSpamProtected method that creates a AntiSpamifier object and passes it's string through AntiSpamifier::SpamProtect() before returning it.

Still, it might be hard to make it relatively easy to validate what the user types for example in the reCaptcha field.

EDIT: Spelling.

Go to Top