From eee426dd6963f14c52386339d7e0556160127614 Mon Sep 17 00:00:00 2001 From: Aleksei Miheev Date: Fri, 5 Sep 2014 14:17:27 +0000 Subject: [PATCH] convert string IP to int by PHP instead of MySQL --- Sources/Subs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Subs.php b/Sources/Subs.php index fc9a8e6..492f668 100644 --- a/Sources/Subs.php +++ b/Sources/Subs.php @@ -1436,6 +1436,7 @@ function writeLog($force = false) // Guests use 0, members use their session ID. $session_id = $user_info['is_guest'] ? 'ip' . $user_info['ip'] : session_id(); + $ip = ip2long($userinfo['ip']); db_query(" DELETE FROM {$db_prefix}log_online @@ -1444,7 +1445,7 @@ function writeLog($force = false) db_query(" INSERT IGNORE INTO {$db_prefix}log_online (session, ID_MEMBER, ip, url) - VALUES ('$session_id', $ID_MEMBER, IFNULL(INET_ATON('$user_info[ip]'), 0), '$serialized')", __FILE__, __LINE__); + VALUES ('${session_id}', '${ID_MEMBER}', '${ip}', '${serialized}')", __FILE__, __LINE__); // Well, they are online now. if (empty($_SESSION['timeOnlineUpdated']))