diff --git a/install/index.php b/install/index.php
index 1031a2b8..5dc457f8 100644
--- a/install/index.php
+++ b/install/index.php
@@ -183,14 +183,14 @@ clearstatcache();
if(is_writable(CACHE) && (MYAAC_OS != 'WINDOWS' || win_is_writable(CACHE))) {
if(!file_exists(BASE . 'install/ip.txt')) {
$content = warning('AAC installation is disabled. To enable it make file ip.txt in install/ directory and put there your IP.
- Your IP is:
' . $_SERVER['REMOTE_ADDR'] . '', true);
+ Your IP is:
' . get_browser_real_ip() . '', true);
}
else {
$file_content = trim(file_get_contents(BASE . 'install/ip.txt'));
$allow = false;
$listIP = preg_split('/\s+/', $file_content);
foreach($listIP as $ip) {
- if($_SERVER['REMOTE_ADDR'] == $ip) {
+ if(get_browser_real_ip() == $ip) {
$allow = true;
}
}
@@ -199,7 +199,7 @@ if(is_writable(CACHE) && (MYAAC_OS != 'WINDOWS' || win_is_writable(CACHE))) {
{
$content = warning('In file install/ip.txt must be your IP!
In file is:
' . nl2br($file_content) . '
- Your IP is:
' . $_SERVER['REMOTE_ADDR'] . '', true);
+ Your IP is:
' . get_browser_real_ip() . '', true);
}
else {
ob_start();
diff --git a/system/pages/account/create.php b/system/pages/account/create.php
index 9fba8237..af427d37 100644
--- a/system/pages/account/create.php
+++ b/system/pages/account/create.php
@@ -331,7 +331,7 @@ if(setting('core.account_country_recognize')) {
$country_recognized = $country_session;
}
else {
- $info = json_decode(@file_get_contents('http://ipinfo.io/' . $_SERVER['REMOTE_ADDR'] . '/geo'), true);
+ $info = json_decode(@file_get_contents('http://ipinfo.io/' . get_browser_real_ip() . '/geo'), true);
if(isset($info['country'])) {
$country_recognized = strtolower($info['country']);
setSession('country', $country_recognized);
diff --git a/system/pages/forum/new_thread.php b/system/pages/forum/new_thread.php
index 7a66ac27..d10e7a11 100644
--- a/system/pages/forum/new_thread.php
+++ b/system/pages/forum/new_thread.php
@@ -95,7 +95,7 @@ if(Forum::canPost($account_logged)) {
if (count($errors) == 0) {
$saved = true;
- $db->query("INSERT INTO `" . FORUM_TABLE_PREFIX . "forum` (`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile`, `post_html` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`) VALUES ('0', '" . time() . "', '" . (int)$section_id . "', '0', '0', '" . $account_logged->getId() . "', '" . $char_id . "', " . $db->quote($text) . ", " . $db->quote($post_topic) . ", '" . $smile . "', '" . $html . "', '" . time() . "', '0', '0', '" . $_SERVER['REMOTE_ADDR'] . "')");
+ $db->query("INSERT INTO `" . FORUM_TABLE_PREFIX . "forum` (`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile`, `post_html` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`) VALUES ('0', '" . time() . "', '" . (int)$section_id . "', '0', '0', '" . $account_logged->getId() . "', '" . $char_id . "', " . $db->quote($text) . ", " . $db->quote($post_topic) . ", '" . $smile . "', '" . $html . "', '" . time() . "', '0', '0', '" . get_browser_real_ip() . "')");
$thread_id = $db->lastInsertId();
diff --git a/system/src/Forum.php b/system/src/Forum.php
index ec9baee5..64b22222 100644
--- a/system/src/Forum.php
+++ b/system/src/Forum.php
@@ -72,7 +72,7 @@ class Forum
'post_smile' => 0, 'post_html' => 1,
'post_date' => time(),
'last_edit_aid' => 0, 'edit_date' => 0,
- 'post_ip' => $_SERVER['REMOTE_ADDR']
+ 'post_ip' => get_browser_real_ip()
))) {
$thread_id = $db->lastInsertId();
$db->query("UPDATE `" . FORUM_TABLE_PREFIX . "forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id);
@@ -94,7 +94,7 @@ class Forum
'post_smile' => $smile,
'post_html' => $html,
'post_date' => time(),
- 'post_ip' => $_SERVER['REMOTE_ADDR']
+ 'post_ip' => get_browser_real_ip()
));
}
public static function add_board($name, $description, $access, $guild, &$errors)
diff --git a/system/src/Visitors.php b/system/src/Visitors.php
index 32220c6a..9968a214 100644
--- a/system/src/Visitors.php
+++ b/system/src/Visitors.php
@@ -37,7 +37,7 @@ class Visitors
$this->sessionTime = $sessionTime;
$this->cleanVisitors();
- $ip = $_SERVER['REMOTE_ADDR'];
+ $ip = get_browser_real_ip();
$userAgentShortened = substr($_SERVER['HTTP_USER_AGENT'] ?? 'unknown', 0, 255);
if($this->visitorExists($ip))