Last modified: 2010-05-15 15:48:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 9123 - wrong timezone offset calculation with $wgLocalTZoffset
wrong timezone offset calculation with $wgLocalTZoffset
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.9.x
PC Windows XP
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-28 00:52 UTC by Tatsuya Aoyagi
Modified: 2010-05-15 15:48 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tatsuya Aoyagi 2007-02-28 00:52:10 UTC
XAMPP Apache server crashes when I set $wgLocalTZoffset to 540. I found a bug in
Language.php. See below.

$ diff -c languages/Language.php languages/Language.php.org
*** languages/Language.php      Wed Feb 28 09:48:57 2007
--- languages/Language.php.org  Wed Feb 21 11:20:42 2007
***************
*** 394,401 ****
                if ( $tz === '' ) {
                        #ツGlobal offset in minutes.
                        if( isset($wgLocalTZoffset) ) {
!                               $hrDiff = $wgLocalTZoffset / 60;
!                               $minDiff = $wgLocalTZoffset % 60;
                        }
                } elseif ( strpos( $tz, ':' ) !== false ) {
                        $tzArray = explode( ':', $tz );
--- 394,401 ----
                if ( $tz === '' ) {
                        #ツGlobal offset in minutes.
                        if( isset($wgLocalTZoffset) ) {
!                               $hrDiff = $wgLocalTZoffset % 60;
!                               $minDiff = $wgLocalTZoffset - ($hrDiff * 60);
                        }
                } elseif ( strpos( $tz, ':' ) !== false ) {
                        $tzArray = explode( ':', $tz );
Comment 1 Brion Vibber 2007-03-06 14:40:31 UTC
Er, what's wrong with it?

If your server is *crashing* on basic arithmetic, I think you've got bigger
problems.
Comment 2 Tatsuya Aoyagi 2007-03-09 14:52:07 UTC
I've not yet tracked down the reason of the server crash. Aside from the server
crash, the calculation of $hrDiff and $minDiff in the original source seems
wrong. For example, when $wgLocalTZoffset is 30(min), $hrDiff becomes 30(hour)
and $minDiff becomes -1770(min).
Comment 3 Antoine "hashar" Musso (WMF) 2007-05-13 11:55:12 UTC
Internally adding 5 minutes was considered +5 hours then - 295 minutes.
I changed it with r22142. Thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links