diff options
Diffstat (limited to 'core/Date.php')
-rw-r--r-- | core/Date.php | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/core/Date.php b/core/Date.php index f2c6a94512..3c7962ce1e 100644 --- a/core/Date.php +++ b/core/Date.php @@ -44,7 +44,6 @@ class Piwik_Date */ static public function factory($dateString, $timezone = null) { - $invalidDateException = new Exception(Piwik_TranslateException('General_ExceptionInvalidDateFormat', array("YYYY-MM-DD, or 'today' or 'yesterday'", "strtotime", "http://php.net/strtotime"))); if($dateString instanceof self) { $dateString = $dateString->toString(); @@ -74,18 +73,12 @@ class Piwik_Date ($dateString = strtotime($dateString)) === false )) { - throw $invalidDateException; + throw new Exception(Piwik_TranslateException('General_ExceptionInvalidDateFormat', array("YYYY-MM-DD, or 'today' or 'yesterday'", "strtotime", "http://php.net/strtotime"))); } else { $date = new Piwik_Date($dateString); } - $timestamp = $date->getTimestamp(); - if($timestamp < 681436800 // can't be doing web analytics before the 1st website - || $timestamp > 7289049600 // piwik is designed to last (date lib will break long before that) - ) { - throw $invalidDateException; - } if(empty($timezone)) { return $date; |