Fixed InvalidArgumentException: Invalid string IP: e\v in src/XF/Util/Ip.php at line 17

Phun

Member
Affected version
2.3 beta 8
Code:
InvalidArgumentException: Invalid string IP: e\v in src/XF/Util/Ip.php at line 17
XF\Util\Ip::stringToBinary() in src/XF/Import/Data/AbstractData.php at line 275
XF\Import\Data\AbstractData->importRawIp() in src/XF/Import/Data/User.php at line 340
XF\Import\Data\User->postSave() in src/XF/Import/Data/AbstractData.php at line 138
XF\Import\Data\AbstractData->save() in src/XF/Import/Helper.php at line 127
XF\Import\Helper->importUser() in src/XF/Import/Importer/AbstractCoreImporter.php at line 107
XF\Import\Importer\AbstractCoreImporter->importUser() in src/addons/XFI/Import/Importer/MyBb.php at line 519
XFI\Import\Importer\MyBb->stepUsers() in src/XF/Import/Runner.php at line 244
XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 61
XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line 234
XF\Admin\Controller\Import->actionRun() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 258
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2607
XF\App->run() in src/XF.php at line 533
XF::runApp() in admin.php at line 13

Newly installed XF with the beta of 2.3 importing system with merging from MyBB to XF 2.3
 
Last edited:
I had to comment this out...for it work.
Code:
throw new \InvalidArgumentException('Invalid string IP: ' . $ip);
 
This appears to be caused when you modify your Xenforo install to support HTTP_X_FORWARDED_FOR headers like so:
PHP:
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))

{

        $_SERVER['REMOTE_ADDR'] =  $_SERVER['HTTP_X_FORWARDED_FOR']);

}

Doing something like this helps:

PHP:
$_SERVER['REMOTE_ADDR'] = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0];

However XenForo needs to generally handle this better
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.0).

Change log:
Skip importing invalid binary IP addresses during imports
There may be a delay before changes are rolled out to the XenForo Community.
 
Closed bug reports are not monitored, and this is unlikely to be a bug. You can post a thread in the troubleshooting forum for support.
 
Back
Top Bottom