aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/install/database_update.php7
-rw-r--r--phpBB/install/install_install.php3
3 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 79c594ed6d..006c3617f7 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -56,7 +56,7 @@ class acp_users
$this->page_title = 'WHOIS';
$this->tpl_name = 'simple_body';
- $user_ip = request_var('user_ip', '');
+ $user_ip = phpbb_ip_normalise(request_var('user_ip', ''));
$domain = gethostbyaddr($user_ip);
$ipwhois = user_ipwhois($user_ip);
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 9aa7a34f6b..b33c0f4a11 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -127,8 +127,11 @@ $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
// We do not need this any longer, unset for safety purposes
unset($dbpasswd);
-$user->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
-$user->ip = (stripos($user->ip, '::ffff:') === 0) ? substr($user->ip, 7) : $user->ip;
+$user->ip = '';
+if (!empty($_SERVER['REMOTE_ADDR']))
+{
+ $user->ip = (function_exists('phpbb_ip_normalise')) ? phpbb_ip_normalise($_SERVER['REMOTE_ADDR']) : htmlspecialchars($_SERVER['REMOTE_ADDR']);
+}
$sql = "SELECT config_value
FROM " . CONFIG_TABLE . "
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index eaad2ed7e0..8143ea7737 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1235,8 +1235,7 @@ class install_install extends module
$current_time = time();
- $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
- $user_ip = (stripos($user_ip, '::ffff:') === 0) ? substr($user_ip, 7) : $user_ip;
+ $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? phpbb_ip_normalise($_SERVER['REMOTE_ADDR']) : '';
if ($data['script_path'] !== '/')
{