mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
fixed the not-always-working patch of 1.26
This commit is contained in:
parent
28e6333990
commit
ffd1de75c6
@ -430,32 +430,15 @@
|
|||||||
*/
|
*/
|
||||||
function phpgw_set_cookiedomain()
|
function phpgw_set_cookiedomain()
|
||||||
{
|
{
|
||||||
$dom = $_SERVER['HTTP_HOST'];
|
$this->cookie_domain = $_SERVER['HTTP_HOST'];
|
||||||
if (preg_match("/^(.*):(.*)$/",$dom,$arr))
|
|
||||||
|
// remove port from HTTP_HOST
|
||||||
|
if (preg_match("/^(.*):(.*)$/",$this->cookie_domain,$arr))
|
||||||
{
|
{
|
||||||
$dom = $arr[1];
|
$this->cookie_domain = $arr[1];
|
||||||
}
|
|
||||||
$parts = explode('.',$dom);
|
|
||||||
if (count($parts) > 2)
|
|
||||||
{
|
|
||||||
if (!ereg('[0-9]+',$parts[1]))
|
|
||||||
{
|
|
||||||
for($i=0;$i<count($parts);$i++)
|
|
||||||
{
|
|
||||||
$this->cookie_domain .= '.'.$parts[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->cookie_domain = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->cookie_domain = '';
|
|
||||||
}
|
}
|
||||||
print_debug('COOKIE_DOMAIN',$this->cookie_domain,'api');
|
print_debug('COOKIE_DOMAIN',$this->cookie_domain,'api');
|
||||||
|
|
||||||
$this->set_cookie_params($this->cookie_domain); // for php4 sessions necessary
|
$this->set_cookie_params($this->cookie_domain); // for php4 sessions necessary
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +455,7 @@
|
|||||||
{
|
{
|
||||||
$this->phpgw_set_cookiedomain();
|
$this->phpgw_set_cookiedomain();
|
||||||
}
|
}
|
||||||
setcookie($cookiename,$cookievalue,$cookietime,'/',$this->cookie_domain);
|
setcookie($cookiename,$cookievalue,$cookietime,'/',$this->cookie_domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user