1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed API Registration Spam Check

Discussion in 'Resolved Bug Reports' started by mdgross, Jun 10, 2015.

  1. mdgross

    mdgross Member

    I'd like to replicate XenForo's spam check during registration through an API request. I have reviewed [bd] API and XenAPI and neither make use of XenForo_Model_SpamPrevention during the registration process. I have attempted to add this code:

    $writer = XenForo_DataWriter::create('XenForo_DataWriter_User');
    $spamModel = XenForo_Model::create('XenForo_Model_SpamPrevention');
    $spamResponse = $spamModel->allowRegistration($writer->getMergedData(), new Zend_Controller_Request_Http());

    The above code fails at $dataRegistryModel->set('dnsBlCache', $dnsBlCache); because "Message: Mysqli statement execute error : Lost connection to MySQL server during query." A var_dump of $dnsBlCache returns an array with 165040 elements.

    @xfrocks @Contex
    Last edited: Jun 10, 2015
  2. Mike

    Mike XenForo Developer Staff Member

    This is unrelated to those add-ons. It looks like there's a bug with expiration of this data. You can workaround it by just deleting the dnsBlCache row from the data registry table.
  3. mdgross

    mdgross Member

    @Mike Thank you for looking into this. Is there any issue passing "new Zend_Controller_Request_Http()" instead of $this->_request as the second parameter to $spamModel->allowRegistration?
  4. Mike

    Mike XenForo Developer Staff Member

    I don't see a reason for there to be.

Share This Page