mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-04 05:25:01 +02:00
[feature/new-tz-handling] Use tmp variable for user timezone
PHPBB3-9558
This commit is contained in:
parent
b61ac43abe
commit
48d3c68290
@ -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->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->date_format = $this->data['user_dateformat'];
|
||||||
$this->tz = $this->data['user_timezone'];
|
$user_timezone = $this->data['user_timezone'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->lang_name = basename($config['default_lang']);
|
$this->lang_name = basename($config['default_lang']);
|
||||||
$this->date_format = $config['default_dateformat'];
|
$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
|
* 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
|
// 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
|
// We include common language file here to not load it every time a custom language file is included
|
||||||
$lang = &$this->lang;
|
$lang = &$this->lang;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user