mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Merge pull request #4257 from CHItA/ticket/14564
[ticket/14564] Fix cookie domain calculation
This commit is contained in:
commit
fae305073a
1 changed files with 8 additions and 1 deletions
|
@ -129,12 +129,19 @@ class add_config_settings extends \phpbb\install\task_base
|
|||
$this->db->sql_return_on_error(true);
|
||||
|
||||
$server_name = $this->install_config->get('server_name');
|
||||
$cookie_domain = $this->install_config->get('cookie_domain');
|
||||
$current_time = time();
|
||||
$user_ip = phpbb_ip_normalise($this->iohandler->get_server_variable('REMOTE_ADDR'));
|
||||
$user_ip = ($user_ip === false) ? '' : $user_ip;
|
||||
$referer = $this->iohandler->get_server_variable('REFERER');
|
||||
|
||||
// Calculate cookie domain
|
||||
$cookie_domain = $server_name;
|
||||
|
||||
if (strpos($cookie_domain, 'www.') === 0)
|
||||
{
|
||||
$cookie_domain = substr($cookie_domain, 3);
|
||||
}
|
||||
|
||||
// Set default config and post data, this applies to all DB's
|
||||
$sql_ary = array(
|
||||
'INSERT INTO ' . $this->config_table . " (config_name, config_value)
|
||||
|
|
Loading…
Add table
Reference in a new issue