diff options
author | Chris Smith <toonarmy@phpbb.com> | 2010-07-07 22:17:40 +0100 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-14 22:57:29 -0400 |
commit | 6a783b843b596c46738d76f2db5d539d8f68a815 (patch) | |
tree | 5e979aefcb6f15f99f5f2db6557578868251e198 | |
parent | 9e1812a0ca728aee69df9ec5b86ea21756d3b1cc (diff) | |
download | forums-6a783b843b596c46738d76f2db5d539d8f68a815.tar forums-6a783b843b596c46738d76f2db5d539d8f68a815.tar.gz forums-6a783b843b596c46738d76f2db5d539d8f68a815.tar.bz2 forums-6a783b843b596c46738d76f2db5d539d8f68a815.tar.xz forums-6a783b843b596c46738d76f2db5d539d8f68a815.zip |
[feature/new-tz-handling] Replace user::$timezone with user::$tz.
user::$tz will store the new DateTimeZone object representing the users
timezone instead of the existing user::$timezone and user::$dst combination.
PHPBB3-9558
-rw-r--r-- | phpBB/includes/session.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index fe690a1a9a..2352e6394a 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1528,7 +1528,14 @@ class user extends session var $help = array(); var $theme = array(); var $date_format; - var $timezone; + + /** + * Users current timezone + * + * @var DateTimeZone Timezone of the user + * @since 3.1 + */ + public $tz; var $lang_name = false; var $lang_id = false; @@ -1586,13 +1593,13 @@ class user extends 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->timezone = $this->data['user_timezone']; + $this->tz = $this->data['user_timezone']; } else { $this->lang_name = basename($config['default_lang']); $this->date_format = $config['default_dateformat']; - $this->timezone = $config['board_timezone']; + $this->tz = $config['board_timezone']; /** * If a guest user is surfing, we try to guess his/her language first by obtaining the browser language @@ -1631,13 +1638,13 @@ class user extends session */ } - if (is_numeric($this->timezone)) + if (is_numeric($this->tz)) { // Might still be numeric by chance - $this->timezone = sprintf('Etc/GMT%+d', ($this->timezone + ($this->data['user_id'] != ANONYMOUS ? $this->data['user_dst'] : $config['board_dst']))); + $this->tz = sprintf('Etc/GMT%+d', ($this->tz + ($this->data['user_id'] != ANONYMOUS ? $this->data['user_dst'] : $config['board_dst']))); } - $this->timezone = new DateTimeZone($this->timezone); + $this->tz = new DateTimeZone($this->tz); // We include common language file here to not load it every time a custom language file is included $lang = &$this->lang; |