mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-15 04:24:57 +01:00
fixed cookie prob for setup too
This commit is contained in:
parent
e9c2659778
commit
99303481a2
@ -76,28 +76,16 @@
|
|||||||
*/
|
*/
|
||||||
function set_cookiedomain()
|
function 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(explode('.',$this->cookie_domain)) <= 1)
|
||||||
if (count($parts) > 2)
|
|
||||||
{
|
|
||||||
if (!ereg('[0-9]+',$parts[1]))
|
|
||||||
{
|
|
||||||
for($i=1;$i<count($parts);$i++)
|
|
||||||
{
|
|
||||||
$this->cookie_domain .= '.'.$parts[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->cookie_domain = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
// setcookie dont likes domains without dots, leaving it empty, gets setcookie to fill the domain in
|
||||||
$this->cookie_domain = '';
|
$this->cookie_domain = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user