Workaround for php bug [1], reported in 5.3.2, fixed already
Workaround can be removed when our minimum PHP version is > 5.3.2
[1] https://bugs.php.net/bug.php?id=52063
Change-Id: Ia60e64300787d0b683829765e8eeac1535e9d0a4
$logDBErrorTimeZoneObject = new DateTimeZone( $wgDBerrorLogTZ );
}
- $d = date_create( "now", $logDBErrorTimeZoneObject );
+ // Workaround for https://bugs.php.net/bug.php?id=52063
+ // Can be removed when min PHP > 5.3.2
+ if ( $logDBErrorTimeZoneObject === null ) {
+ $d = date_create( "now" );
+ } else {
+ $d = date_create( "now", $logDBErrorTimeZoneObject );
+ }
$date = $d->format( 'D M j G:i:s T Y' );