forked from leftypol/leftypol
IPv6_IPv4
This commit is contained in:
parent
7e3905d5fd
commit
35325bd011
2 changed files with 13 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
loadConfig();
|
||||
|
||||
function loadConfig() {
|
||||
global $board, $config;
|
||||
global $board, $config, $__ip;
|
||||
|
||||
require 'config.php';
|
||||
if (file_exists('inc/instance-config.php')) {
|
||||
|
@ -54,6 +54,16 @@
|
|||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
}
|
||||
|
||||
if($config['ipv6_ipv4']) {
|
||||
// Keep the original address to properly comply with other board configuartions
|
||||
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[1];
|
||||
}
|
||||
}
|
||||
|
||||
function sprintf3($str, $vars, $delim = '%') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue