1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-01 03:54:56 +02:00

[feature/new-tz-handling] Use tmp variable for user timezone

PHPBB3-9558
This commit is contained in:
Joas Schilling 2012-07-16 18:44:13 +02:00
parent b61ac43abe
commit 48d3c68290

View File

@ -82,13 +82,13 @@ class phpbb_user extends phpbb_session
$this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
$this->date_format = $this->data['user_dateformat'];
$this->tz = $this->data['user_timezone'];
$user_timezone = $this->data['user_timezone'];
}
else
{
$this->lang_name = basename($config['default_lang']);
$this->date_format = $config['default_dateformat'];
$this->tz = $config['board_timezone'];
$user_timezone = $config['board_timezone'];
/**
* If a guest user is surfing, we try to guess his/her language first by obtaining the browser language
@ -127,13 +127,13 @@ class phpbb_user extends phpbb_session
*/
}
if (is_numeric($this->tz))
if (is_numeric($user_timezone))
{
// Might still be numeric
$this->tz = sprintf('Etc/GMT%+d', $this->tz);
$user_timezone = sprintf('Etc/GMT%+d', $user_timezone);
}
$this->tz = new DateTimeZone($this->tz);
$this->tz = new DateTimeZone($user_timezone);
// We include common language file here to not load it every time a custom language file is included
$lang = &$this->lang;