diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2012-07-16 18:29:31 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2012-07-16 18:29:31 +0200 |
| commit | f5bb145040a483a76fd734bb9d4025c54e7917a0 (patch) | |
| tree | 41aeef9b548c7e2efaf69e3f40d112a1ab02f5e1 /phpBB/includes/datetime.php | |
| parent | 82e195ac683f6604aee9862233ffcb4f58af64b0 (diff) | |
| download | forums-f5bb145040a483a76fd734bb9d4025c54e7917a0.tar forums-f5bb145040a483a76fd734bb9d4025c54e7917a0.tar.gz forums-f5bb145040a483a76fd734bb9d4025c54e7917a0.tar.bz2 forums-f5bb145040a483a76fd734bb9d4025c54e7917a0.tar.xz forums-f5bb145040a483a76fd734bb9d4025c54e7917a0.zip | |
[feature/new-tz-handling] Require user argument on phpbb_datetime
PHPBB3-9558
Diffstat (limited to 'phpBB/includes/datetime.php')
| -rw-r--r-- | phpBB/includes/datetime.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/phpBB/includes/datetime.php b/phpBB/includes/datetime.php index 317376431d..0d80c77115 100644 --- a/phpBB/includes/datetime.php +++ b/phpBB/includes/datetime.php @@ -35,10 +35,9 @@ class phpbb_datetime extends DateTime * @param DateTimeZone $timezone Time zone of the time. * @param user User object for context. */ - public function __construct($time = 'now', DateTimeZone $timezone = null, $user = null) + public function __construct($user, $time = 'now', DateTimeZone $timezone = null) { - $this->user = $user ?: $GLOBALS['user']; - + $this->user = $user; $timezone = $timezone ?: $this->user->tz; parent::__construct($time, $timezone); @@ -56,7 +55,7 @@ class phpbb_datetime extends DateTime $format = $format ? $format : $this->user->date_format; $format = self::format_cache($format, $this->user); $relative = ($format['is_short'] && !$force_absolute); - $now = new self('now', $this->user->tz, $this->user); + $now = new self($this->user, 'now', $this->user->tz); $timestamp = $this->getTimestamp(); $now_ts = $now->getTimeStamp(); |
