Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14148

Timezones with partial hours cause core crash

    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
    • Labels:

      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) );

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              tobiaslounsbury Tobias Lounsbury
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 10 minutes
                10m
                Remaining:
                Remaining Estimate - 10 minutes
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified