Merge pull request #4257 from CHItA/ticket/14564

[ticket/14564] Fix cookie domain calculation
This commit is contained in:
Marc Alexander 2016-03-28 00:28:34 +02:00
commit fae305073a

View file

@ -129,12 +129,19 @@ class add_config_settings extends \phpbb\install\task_base
$this->db->sql_return_on_error(true); $this->db->sql_return_on_error(true);
$server_name = $this->install_config->get('server_name'); $server_name = $this->install_config->get('server_name');
$cookie_domain = $this->install_config->get('cookie_domain');
$current_time = time(); $current_time = time();
$user_ip = phpbb_ip_normalise($this->iohandler->get_server_variable('REMOTE_ADDR')); $user_ip = phpbb_ip_normalise($this->iohandler->get_server_variable('REMOTE_ADDR'));
$user_ip = ($user_ip === false) ? '' : $user_ip; $user_ip = ($user_ip === false) ? '' : $user_ip;
$referer = $this->iohandler->get_server_variable('REFERER'); $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 // Set default config and post data, this applies to all DB's
$sql_ary = array( $sql_ary = array(
'INSERT INTO ' . $this->config_table . " (config_name, config_value) 'INSERT INTO ' . $this->config_table . " (config_name, config_value)