Fixed StopForumSpam using binary version of ip address

David G

Member
Affected version
2.0.11
In StopForumSpam.php
PHP:
    protected function getSfsApiSubmitUrl()
    {
        $user = $this->user;
        $ip = $user->getIp('register');
        return 'https://www.stopforumspam.com/add.php'
            . '?api_key=' . $this->app()->options()->stopForumSpam['apiKey']
            . ($user->username ? '&username=' . urlencode($user->username) : '')
            . ($user->email ? '&email=' . urlencode($user->email) : '')
            . '&ip=' . urlencode($ip);
    }
It is trying to send binary version of IP

I changed to :
PHP:
    protected function getSfsApiSubmitUrl()
    {
        $user = $this->user;
        $ip = $user->getIp('register');

        return 'https://www.stopforumspam.com/add.php'
            . '?api_key=' . $this->app()->options()->stopForumSpam['apiKey']
            . ($user->username ? '&username=' . urlencode($user->username) : '')
            . ($user->email ? '&email=' . urlencode($user->email) : '')
            . '&ip=' . urlencode(\XF\Util\Ip::convertIpBinaryToString($ip));
    }

And it now works.
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XF release (2.0.12).

Change log:
When submitting spammers to StopForumSpam, convert binary IP address to readable string.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Back
Top Bottom