Adding spam protection code from current silverstripe.org forum