aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-06-04 22:33:03 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-06-18 15:07:58 +0200
commit09499fb128802bd19cee1550bf6e9af80a9388e2 (patch)
treeb21f965064f77b24d203250d3505f728dc92b449
parent00b5e5345dc44c99340bba932522b6b05b48dab2 (diff)
downloadforums-09499fb128802bd19cee1550bf6e9af80a9388e2.tar
forums-09499fb128802bd19cee1550bf6e9af80a9388e2.tar.gz
forums-09499fb128802bd19cee1550bf6e9af80a9388e2.tar.bz2
forums-09499fb128802bd19cee1550bf6e9af80a9388e2.tar.xz
forums-09499fb128802bd19cee1550bf6e9af80a9388e2.zip
[feature/new-tz-handling] Fix handling of timezone and dst in dateformat_select
PHPBB3-9558
-rw-r--r--phpBB/includes/acp/acp_board.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index d537885ef1..ce2ddc3b0b 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -906,11 +906,13 @@ class acp_board
global $user, $config;
// Let the format_date function operate with the acp values
- $old_tz = $user->timezone;
- $old_dst = $user->dst;
-
- $user->timezone = $config['board_timezone'] * 3600;
- $user->dst = $config['board_dst'] * 3600;
+ $old_tz = $user->tz;
+ if (is_numeric($config['board_timezone']))
+ {
+ // Might still be numeric by chance
+ $config['board_timezone'] = sprintf('Etc/GMT%+d', $config['board_timezone']);
+ }
+ $user->tz = new DateTimeZone($config['board_timezone']);
$dateformat_options = '';
@@ -929,8 +931,7 @@ class acp_board
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
// Reset users date options
- $user->timezone = $old_tz;
- $user->dst = $old_dst;
+ $user->tz = $old_tz;
return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
<input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";