From 1d034894d99813b00cc564dd93f0057ea84f8694 Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 26 Feb 2009 20:12:27 +0000 Subject: merge r3165 from branch 2.0 to trunk bug 913 fixed: ability to connect with an IPv6 address was added. git-svn-id: http://piwigo.org/svn/trunk@3166 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_session.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include/functions_session.inc.php') diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php index a15491193..1145d3dcc 100644 --- a/include/functions_session.inc.php +++ b/include/functions_session.inc.php @@ -93,7 +93,15 @@ function pwg_session_close() function get_remote_addr_session_hash() { - return vsprintf( "%02X%02X", explode('.',$_SERVER['REMOTE_ADDR']) ); + $separator = (FALSE === strpos($_SERVER['REMOTE_ADDR'],'.')) + ? ':' + : '.' + ; + + return vsprintf( + "%02X%02X", + explode($separator,$_SERVER['REMOTE_ADDR']) + ); } /** @@ -217,4 +225,4 @@ function pwg_unset_session_var($var) return true; } -?> \ No newline at end of file +?> -- cgit v1.2.3