Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.3
-
Fix Version/s: 4.4.5
-
Component/s: Core CiviCRM
Description
When a CMS user has selected a timezone that is defined as part of an hour such as America/Caracas the sprintf function on line 204 of CRM/Utils/System/Base.php returns negative hours and negative minutes.
This causes a system halting mysql error later in execution.
The function should return positive minutes.
Example:
America/Caracas is GMT-0430
getTimeZoneOffset returns "-4:-30" when it should return "-4:30".
Solution:
Base.php:204 -$timeZoneOffset = sprintf("%02d:%02d", $tz / 3600, ($tz/60)%60 );
Base.php:204 +$timeZoneOffset = sprintf("%02d:%02d", $tz / 3600, abs(($tz/60)%60) );