diff --git a/upload/install/include/install_function.php b/upload/install/include/install_function.php index c23c7362532731ed12b9bb30c688ae79e5342765..32b6dcab816dea61f7ab9bac24440e31fb351351 100644 --- a/upload/install/include/install_function.php +++ b/upload/install/include/install_function.php @@ -1678,7 +1678,7 @@ function uc_write_config($config, $file, $password) { $config .= "define('UC_PPP', 20);\r\n"; $config .= "define('UC_ONLYREMOTEADDR', 1);\r\n"; $config .= "define('UC_IPGETTER', 'header');\r\n"; - $config .= "define('UC_IPGETTER_HEADER', array('header' => 'HTTP_X_FORWARDED_FOR'));\r\n"; + $config .= "// define('UC_IPGETTER_HEADER', serialize(array('header' => 'HTTP_X_FORWARDED_FOR')));\r\n"; file_put_contents($file, $config); } diff --git a/upload/uc_client/model/base.php b/upload/uc_client/model/base.php index d9b514c8c57b67e7b2d29a87904c0035d8555b82..3772401008a7ea005915ebf34a8af2f2ab0fdd5d 100644 --- a/upload/uc_client/model/base.php +++ b/upload/uc_client/model/base.php @@ -57,7 +57,7 @@ class base { if (!defined('UC_ONLYREMOTEADDR') || (defined('UC_ONLYREMOTEADDR') && !constant('UC_ONLYREMOTEADDR'))) { require_once UC_ROOT.'./lib/ucip.class.php'; if(defined('UC_IPGETTER') && !empty(constant('UC_IPGETTER'))) { - $s = defined('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER'))) && is_array(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) ? constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER'))) : array(); + $s = defined('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER'))) ? (is_string(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) ? unserialize(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) : constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) : array(); $c = 'ucip_getter_'.strtolower(constant('UC_IPGETTER')); require_once UC_ROOT.'./lib/'.$c.'.class.php'; $r = $c::get($s); diff --git a/upload/uc_server/install/func.inc.php b/upload/uc_server/install/func.inc.php index d41a0114d0175e3be8b9439c0b65dcda706ca588..6c6ea78ac28ebcb597b4f2e05db0bd023dff86c0 100644 --- a/upload/uc_server/install/func.inc.php +++ b/upload/uc_server/install/func.inc.php @@ -643,7 +643,7 @@ function config_edit() { $config .= "define('UC_PPP', 20);\r\n"; $config .= "define('UC_ONLYREMOTEADDR', 1);\r\n"; $config .= "define('UC_IPGETTER', 'header');\r\n"; - $config .= "define('UC_IPGETTER_HEADER', array('header' => 'HTTP_X_FORWARDED_FOR'));\r\n"; + $config .= "// define('UC_IPGETTER_HEADER', serialize(array('header' => 'HTTP_X_FORWARDED_FOR')));\r\n"; file_put_contents(CONFIG, $config); } diff --git a/upload/uc_server/model/base.php b/upload/uc_server/model/base.php index 59ee3b61fe2e7e44fe9afc3317c00e50ef916c1c..3cdba5f6b48cc982cbd032a09dcd6662e7c0de09 100644 --- a/upload/uc_server/model/base.php +++ b/upload/uc_server/model/base.php @@ -50,7 +50,7 @@ class base { if (!defined('UC_ONLYREMOTEADDR') || (defined('UC_ONLYREMOTEADDR') && !constant('UC_ONLYREMOTEADDR'))) { require_once UC_ROOT.'./lib/ucip.class.php'; if(defined('UC_IPGETTER') && !empty(constant('UC_IPGETTER'))) { - $s = defined('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER'))) && is_array(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) ? constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER'))) : array(); + $s = defined('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER'))) ? (is_string(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) ? unserialize(constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) : constant('UC_IPGETTER_'.strtoupper(constant('UC_IPGETTER')))) : array(); $c = 'ucip_getter_'.strtolower(constant('UC_IPGETTER')); require_once UC_ROOT.'./lib/'.$c.'.class.php'; $r = $c::get($s);