tenants
Well-known member
I was using this, and it works 99% of the time:
but I've noticed a bug when logging certain IP address (it's rare), and for me only causes a logging empty field.
When this happened, I think, or I believe the original IP was '172.94.59.10', this was grabbed with
then got stored as a var binary 16 in the database as ac5e3b
but this returns false when using XenForo_Helper_Ip::convertIpBinaryToString($binIP);
I suspect is has something to do with using the TYPE_STRING in the datawritter rather than something binary, what should I be using?
The core doesn't use a datawritter for storing IPs, and does it directly from the model, so I cant find a good example
Code:
'ip_address' => array('type' => self::TYPE_STRING)
but I've noticed a bug when logging certain IP address (it's rare), and for me only causes a logging empty field.
When this happened, I think, or I believe the original IP was '172.94.59.10', this was grabbed with
Code:
'XenForo_Helper_Ip::getBinaryIp();
then got stored as a var binary 16 in the database as ac5e3b
but this returns false when using XenForo_Helper_Ip::convertIpBinaryToString($binIP);
I suspect is has something to do with using the TYPE_STRING in the datawritter rather than something binary, what should I be using?
The core doesn't use a datawritter for storing IPs, and does it directly from the model, so I cant find a good example
Code:
$this->_getDb()->insert('xf_ip', array(
'user_id' => $userId,
'content_type' => $contentType,
'content_id' => $contentId,
'action' => $action,
'ip' => $ipAddress,
'log_date' => max(0, $date)
));
Last edited: