aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_session.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2009-02-26 20:09:26 +0000
committerplegall <plg@piwigo.org>2009-02-26 20:09:26 +0000
commita1993b66d145ac59c536469122699b3da9477a49 (patch)
tree1ffaa927fae178187259f9470592aa14cf22fa2b /include/functions_session.inc.php
parenteb85efa77d7b7c64b8f441fb71ab9f797e9c62c4 (diff)
bug 913 fixed: ability to connect with an IPv6 address was added.
git-svn-id: http://piwigo.org/svn/branches/2.0@3165 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_session.inc.php12
1 files changed, 10 insertions, 2 deletions
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
+?>