From: Chad Horohoe Date: Mon, 24 Sep 2012 14:03:30 +0000 (-0400) Subject: Remove some PHP 5.1 cruft (DateTime has existed since 5.2.0) X-Git-Tag: 1.31.0-rc.0~22291^2~1 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=4f1f27b664c2e4427eae6187a5ab4d93fe75e03e;p=lhc%2Fweb%2Fwiklou.git Remove some PHP 5.1 cruft (DateTime has existed since 5.2.0) Change-Id: Id1fc9c874906dcc44abab5b557c8138e6b7ecc50 --- diff --git a/includes/Timestamp.php b/includes/Timestamp.php index fed95c0ced..a5844b6722 100644 --- a/includes/Timestamp.php +++ b/includes/Timestamp.php @@ -140,14 +140,10 @@ class MWTimestamp { $strtime = call_user_func_array( "sprintf", $da ); } - if( function_exists( "date_create" ) ) { - try { - $final = new DateTime( $strtime, new DateTimeZone( 'GMT' ) ); - } catch(Exception $e) { - throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' ); - } - } else { - $final = strtotime( $strtime ); + try { + $final = new DateTime( $strtime, new DateTimeZone( 'GMT' ) ); + } catch(Exception $e) { + throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' ); } if( $final === false ) {