src/View/Helper/AlaxosFormHelper.php
public function antispam($form_dom_id)
    {
        $salt  = isset($this->_View->viewVars['_alaxos_spam_filter_salt']) ? $this->_View->viewVars['_alaxos_spam_filter_salt'] : null;
        $token = SecurityTool::get_today_token($salt);

        /*
         * Unlock hidden field added by JS to prevent blackholing of form
         */
        $fieldname = SecurityTool::get_today_fieldname($salt);
        $this->unlockField($fieldname);

        return $this->AlaxosHtml->script(Router::url(['prefix' => false, 'plugin' => 'Alaxos', 'controller' => 'Javascripts', 'action' => 'antispam', '_ext' => 'js', '?' => ['fid' => $form_dom_id, 'token' => $token]], true), ['block' => true]);
    }
public function antispam($form_dom_id)
    {
        $salt  = isset($this->_View->viewVars['_alaxos_spam_filter_salt']) ? $this->_View->viewVars['_alaxos_spam_filter_salt'] : null;
        $token = SecurityTool::get_today_token($salt);

        /*
         * Unlock hidden field added by JS to prevent blackholing of form
         */
        $fieldname = SecurityTool::get_today_fieldname($salt);
        $this->unlockField($fieldname);

        return $this->AlaxosHtml->script(Router::url(['prefix' => false, 'plugin' => 'Alaxos', 'controller' => 'Javascripts', 'action' => 'antispam', '_ext' => 'js', '?' => ['fid' => $form_dom_id, 'token' => $token]], true), ['block' => true]);
    }
public function antispam ( $ form_dom_id ) { $ salt = isset ( $ this -> _View -> viewVars [ '_alaxos_spam_filter_salt' ] ) ? $ this -> _View -> viewVars [ '_alaxos_spam_filter_salt' ] : null ; $ token = SecurityTool :: get_today_token ( $ salt ) ; /*
         * Unlock hidden field added by JS to prevent blackholing of form
         */ $ fieldname = SecurityTool :: get_today_fieldname ( $ salt ) ; $ this -> unlockField ( $ fieldname ) ; return $ this -> AlaxosHtml -> script ( Router :: url ( [ 'prefix' => false , 'plugin' => 'Alaxos' , 'controller' => 'Javascripts' , 'action' => 'antispam' , '_ext' => 'js' , '?' => [ 'fid' => $ form_dom_id , 'token' => $ token ] ] , true ) , [ 'block' => true ] ) ; }
Add some JS code that add a hidden field
If the hidden field is not present in the POST, SpamFilterComponent considers the request as spam.
Add some JS code that add a hidden field If the hidden field is not present in the POST SpamFilterComponent considers the request as spam .