W1zzardTPU / XenForo_TPUDetectSpamReg

Detect and Block Spam Registrations (XenForo Addon)
https://xenforo.com/community/resources/tpu-detect-and-block-spam-registrations.2973/
7 stars 7 forks source link

Fix "Undefined variable: dns" when AS lookup fails. #1

Closed Xon closed 8 years ago

Xon commented 8 years ago

Fixes the following error, caused when the AS lookup fails for some reason.

ErrorException: Undefined variable: dns - library/TPUDetectSpamReg/AS.php:40 
Generated By: Unknown Account, Today at 2:08 PM
#0 /var/www/html/library/TPUDetectSpamReg/AS.php(40): XenForo_Application::handlePhpError(8, 'Undefined varia...', '/var/www/sites/...', 40, Array)
#1 /var/www/html/library/TPUDetectSpamReg/AS.php(79): TPUDetectSpamReg_AS::getASNameAndNumber('129.72.154.121', NULL, NULL)
#2 [internal function]: TPUDetectSpamReg_AS::getRegSpamScore(Array, Array, '1', '0', Object(TPUDetectSpamReg_ModelSpamPrevention))
#3 /var/www/html/library/XenForo/CodeEvent.php(90): call_user_func_array(Array, Array)
#4 /var/www/html/library/TPUDetectSpamReg/ModelSpamPrevention.php(67): XenForo_CodeEvent::fire('tpu_detect_spam...', Array)
#5 /var/www/html/library/XenForo/ControllerPublic/Register.php(1426): TPUDetectSpamReg_ModelSpamPrevention->allowRegistration(Array, Object(Zend_Controller_Request_Http))
#6 /var/www/html/library/XenForo/ControllerPublic/Register.php(401): XenForo_ControllerPublic_Register->_runSpamCheck(Object(KL_PasswordTools_DataWriter_User), Array)
#7 /var/www/html/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Register->actionRegister()
#8 /var/www/html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /var/www/html/index.php(13): XenForo_FrontController->run()
#10 {main}
Xon commented 8 years ago

@W1zzardTPU Have you had a chance to loo at this?