mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[feature/new-tz-handling] Inject $user to avoid the usage of global
PHPBB3-9558
This commit is contained in:
parent
2a880dafdf
commit
9836efc13c
1 changed files with 2 additions and 2 deletions
|
@ -1145,7 +1145,7 @@ function tz_select($default = '', $truncate = false, $return_tzs_only = true)
|
||||||
foreach ($unsorted_timezones as $timezone)
|
foreach ($unsorted_timezones as $timezone)
|
||||||
{
|
{
|
||||||
$tz = new DateTimeZone($timezone);
|
$tz = new DateTimeZone($timezone);
|
||||||
$dt = new phpbb_datetime('now', $tz);
|
$dt = new phpbb_datetime('now', $tz, $user);
|
||||||
$offset = $dt->getOffset();
|
$offset = $dt->getOffset();
|
||||||
$current_time = $dt->format($user->lang['DATETIME_FORMAT'], true);
|
$current_time = $dt->format($user->lang['DATETIME_FORMAT'], true);
|
||||||
$offset_string = phpbb_format_timezone_offset($offset);
|
$offset_string = phpbb_format_timezone_offset($offset);
|
||||||
|
@ -4794,7 +4794,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$dt = new phpbb_datetime('now', $user->tz);
|
$dt = new phpbb_datetime('now', $user->tz, $user);
|
||||||
$timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset());
|
$timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset());
|
||||||
$timezone_name = $user->tz->getName();
|
$timezone_name = $user->tz->getName();
|
||||||
if (isset($user->lang['timezones'][$timezone_name]))
|
if (isset($user->lang['timezones'][$timezone_name]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue