r89873 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89872‎ | r89873 | r89874 >
Date:08:03, 11 June 2011
Author:ialex
Status:ok
Tags:
Comment:
Removed usage of error suppression operator, also removed function_exists() check for timezone_open() since we now require PHP 5.2.3
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -759,9 +759,12 @@
760760 $data = explode( '|', $tz, 3 );
761761
762762 if ( $data[0] == 'ZoneInfo' ) {
763 - if ( function_exists( 'timezone_open' ) && @timezone_open( $data[2] ) !== false ) {
 763+ wfSuppressWarnings();
 764+ $userTZ = timezone_open( $data[2] );
 765+ wfRestoreWarnings();
 766+ if ( $userTZ !== false ) {
764767 $date = date_create( $ts, timezone_open( 'UTC' ) );
765 - date_timezone_set( $date, timezone_open( $data[2] ) );
 768+ date_timezone_set( $date, $userTZ );
766769 $date = date_format( $date, 'YmdHis' );
767770 return $date;
768771 }

Status & tagging log