From 4f1f27b664c2e4427eae6187a5ab4d93fe75e03e Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 24 Sep 2012 10:03:30 -0400 Subject: [PATCH] Remove some PHP 5.1 cruft (DateTime has existed since 5.2.0) Change-Id: Id1fc9c874906dcc44abab5b557c8138e6b7ecc50 --- includes/Timestamp.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 ) { -- 2.20.1