diff --git a/admin/modules/user/mass_mail.php b/admin/modules/user/mass_mail.php index 7dd5f95315..c607bbbea1 100644 --- a/admin/modules/user/mass_mail.php +++ b/admin/modules/user/mass_mail.php @@ -82,7 +82,7 @@ $html_personalisation = substr($html_personalisation, 0, -2)."');\n// -->\n"; $text_personalisation = substr($text_personalisation, 0, -2)."');\n// -->\n"; - $localized_time_offset = $mybb->user['timezone']*3600 + $mybb->user['dst']*3600; + $localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600; // All done here if($mybb->request_method == "post") @@ -615,7 +615,7 @@ function insertText(value, textarea) $plugins->run_hooks("admin_user_mass_email_send_start"); - $localized_time_offset = $mybb->user['timezone']*3600 + $mybb->user['dst']*3600; + $localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600; if($mybb->input['step'] == 4) { diff --git a/admin/modules/user/users.php b/admin/modules/user/users.php index c6ae013f43..67508b2603 100644 --- a/admin/modules/user/users.php +++ b/admin/modules/user/users.php @@ -1024,11 +1024,11 @@ $reg_date = my_date('relative', $user['regdate']); if($user['dst'] == 1) { - $timezone = $user['timezone']+1; + $timezone = (float)$user['timezone']+1; } else { - $timezone = $user['timezone']; + $timezone = (float)$user['timezone']; } $local_date = gmdate($mybb->settings['dateformat'], TIME_NOW + ($timezone * 3600)); $local_time = gmdate($mybb->settings['timeformat'], TIME_NOW + ($timezone * 3600)); diff --git a/calendar.php b/calendar.php index 19e5a276af..6533e1b3da 100644 --- a/calendar.php +++ b/calendar.php @@ -799,6 +799,7 @@ } $event['name'] = htmlspecialchars_uni($event['name']); + $event['timezone'] = (float)$event['timezone']; add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid'])); add_breadcrumb($event['name'], get_event_link($event['eid'])); @@ -1536,11 +1537,11 @@ if($event['ignoretimezone'] == 0) { - $offset = $event['timezone']; + $offset = (float)$event['timezone']; } else { - $offset = $mybb->user['timezone']; + $offset = (float)$mybb->user['timezone']; } $event['starttime_user'] = $event['starttime']+$offset*3600; @@ -1875,11 +1876,11 @@ if($event['ignoretimezone'] == 0) { - $offset = $event['timezone']; + $offset = (float)$event['timezone']; } else { - $offset = $mybb->user['timezone']; + $offset = (float)$mybb->user['timezone']; } $event['starttime_user'] = $event['starttime']+$offset*3600; diff --git a/global.php b/global.php index 8cb944eaa5..4c4846d2f0 100644 --- a/global.php +++ b/global.php @@ -924,7 +924,7 @@ $auto_dst_detection = ''; if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2) { - $timezone = $mybb->user['timezone'] + $mybb->user['dst']; + $timezone = (float)$mybb->user['timezone'] + $mybb->user['dst']; eval('$auto_dst_detection = "'.$templates->get('global_dst_detection').'";'); } diff --git a/inc/datahandlers/user.php b/inc/datahandlers/user.php index 72b4276d13..cb46c954b2 100644 --- a/inc/datahandlers/user.php +++ b/inc/datahandlers/user.php @@ -917,6 +917,8 @@ function verify_checkfields() */ function verify_timezone() { + global $mybb; + $user = &$this->data; $timezones = get_supported_timezones(); diff --git a/inc/functions.php b/inc/functions.php index 5b0e09ae91..6bd3e0252b 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -343,17 +343,17 @@ function my_date($format, $stamp=0, $offset="", $ty=1, $adodb=false) { if(isset($mybb->user['uid']) && $mybb->user['uid'] != 0 && array_key_exists("timezone", $mybb->user)) { - $offset = $mybb->user['timezone']; + $offset = (float)$mybb->user['timezone']; $dstcorrection = $mybb->user['dst']; } elseif(defined("IN_ADMINCP")) { - $offset = $mybbadmin['timezone']; + $offset = (float)$mybbadmin['timezone']; $dstcorrection = $mybbadmin['dst']; } else { - $offset = $mybb->settings['timezoneoffset']; + $offset = (float)$mybb->settings['timezoneoffset']; $dstcorrection = $mybb->settings['dstcorrection']; } diff --git a/inc/functions_calendar.php b/inc/functions_calendar.php index 99204bfc72..6f2b8bf39a 100644 --- a/inc/functions_calendar.php +++ b/inc/functions_calendar.php @@ -452,11 +452,11 @@ function get_events($calendar, $start, $end, $unapproved=0, $private=1) { if($event['ignoretimezone'] == 0) { - $offset = $event['timezone']; + $offset = (float)$event['timezone']; } else { - $offset = $mybb->user['timezone']; + $offset = (float)$mybb->user['timezone']; } $event['starttime_user'] = $event['starttime']+($offset*3600); diff --git a/member.php b/member.php index fac45ebb06..6bf9354014 100644 --- a/member.php +++ b/member.php @@ -2184,7 +2184,9 @@ eval("\$awaybit = \"".$templates->get("member_profile_away")."\";"); } } - + + $memprofile['timezone'] = (float)$memprofile['timezone']; + if($memprofile['dst'] == 1) { $memprofile['timezone']++; diff --git a/modcp.php b/modcp.php index 79f4877324..ffe8960707 100644 --- a/modcp.php +++ b/modcp.php @@ -1119,7 +1119,7 @@ $mybb->input['starttime_month'] = '01'; } - $localized_time_offset = $mybb->user['timezone']*3600 + $mybb->user['dst']*3600; + $localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600; $startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) -$localized_time_offset; if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false) @@ -1261,7 +1261,7 @@ } else { - $localized_time = TIME_NOW + $mybb->user['timezone']*3600 + $mybb->user['dst']*3600; + $localized_time = TIME_NOW + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600; $starttime_time = gmdate($mybb->settings['timeformat'], $localized_time); $endtime_time = gmdate($mybb->settings['timeformat'], $localized_time); @@ -1492,7 +1492,7 @@ $mybb->input['starttime_month'] = '01'; } - $localized_time_offset = TIME_NOW + $mybb->user['timezone']*3600 + $mybb->user['dst']*3600; + $localized_time_offset = TIME_NOW + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600; $startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) - $localized_time_offset; if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false) @@ -1666,8 +1666,8 @@ } else { - $localized_time_startdate = $announcement['startdate'] + $mybb->user['timezone']*3600 + $mybb->user['dst']*3600; - $localized_time_enddate = $announcement['enddate'] + $mybb->user['timezone']*3600 + $mybb->user['dst']*3600; + $localized_time_startdate = $announcement['startdate'] + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600; + $localized_time_enddate = $announcement['enddate'] + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600; $starttime_time = gmdate($mybb->settings['timeformat'], $localized_time_startdate); $endtime_time = gmdate($mybb->settings['timeformat'], $localized_time_enddate);