summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-11-25 03:02:34 +1100
committerSavetheinternet <savetheinternet@tinyboard.org>2011-11-25 03:02:34 +1100
commit8c2f6d978a69e53c91c831eb47d1a6f686aa9a08 (patch)
treeb466e6b0143ce4a177e9ff0872499f0f5d24ac9c
parent40bc60209693b34def64e076ee1d17f2b632d6c5 (diff)
Automatic transformation of IPv6-IPv4 addresses (::ffff:0.0.0.0) should not be an optional feature.
-rw-r--r--inc/config.php3
-rw-r--r--inc/functions.php16
2 files changed, 7 insertions, 12 deletions
diff --git a/inc/config.php b/inc/config.php
index 151d4972..a2e5b8ae 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -68,9 +68,6 @@
// "302" is strongly recommended. (This shouldn't even be configurable... It's not like it's going to change or anything.)
$config['redirect_http'] = 302;
- // Make IPv4 addresses look like IPv4 addresses ("::ffff:8.8.8.8" becomes "8.8.8.8")
- $config['ipv6_ipv4'] = true;
-
// A small file in the main directory indicating that the script has been ran and the board(s) have been generated.
// This keeps the script from querying the database and causing strain when not needed.
$config['has_installed'] = '.installed';
diff --git a/inc/functions.php b/inc/functions.php
index a40e55eb..c79e3a68 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -97,15 +97,13 @@
ini_set('display_errors', 1);
}
- if($config['ipv6_ipv4'] && isset($_SERVER['REMOTE_ADDR'])) {
- // Keep the original address to properly comply with other board configurations
- if(!isset($__ip))
- $__ip = &$_SERVER['REMOTE_ADDR'];
-
- // ::ffff:0.0.0.0
- if(preg_match('/^\:\:(ffff\:)?(\d+\.\d+\.\d+\.\d+)$/', $__ip, $m))
- $_SERVER['REMOTE_ADDR'] = $m[2];
- }
+ // Keep the original address to properly comply with other board configurations
+ if(!isset($__ip))
+ $__ip = $_SERVER['REMOTE_ADDR'];
+
+ // ::ffff:0.0.0.0
+ if(preg_match('/^\:\:(ffff\:)?(\d+\.\d+\.\d+\.\d+)$/', $__ip, $m))
+ $_SERVER['REMOTE_ADDR'] = $m[2];
if(_setlocale(LC_ALL, $config['locale']) === false) {
$error = function_exists('error') ? 'error' : 'basic_error_function_because_the_other_isnt_loaded_yet';