Last modified: 2010-05-15 15:48:20 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 );
Er, what's wrong with it? If your server is *crashing* on basic arithmetic, I think you've got bigger problems.
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).
Internally adding 5 minutes was considered +5 hours then - 295 minutes. I changed it with r22142. Thanks!