diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2011-04-14 03:24:21 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2011-04-14 03:24:21 +0400 |
commit | 3ff768b1d11947c378a3f4d7a41f9241b72cee7d (patch) | |
tree | 147b219b31a4d8ef901ba2c30e0017024dfd2fe7 /core/Date.php | |
parent | bcc7b949d84e7e8a6b5b86b5c8eb59cea1acb3b9 (diff) |
Previous commit was not complete, lacking timezone support & graphs in UI not working because strtotime was overdoing it
git-svn-id: http://dev.piwik.org/svn/trunk@4438 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Date.php')
-rw-r--r-- | core/Date.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/Date.php b/core/Date.php index 210c8987a4..43e6a4e707 100644 --- a/core/Date.php +++ b/core/Date.php @@ -65,7 +65,13 @@ class Piwik_Date $date = self::yesterdaySameTime(); } elseif (!is_int($dateString) - && ($dateString = strtotime($dateString)) === false) + && ( + // strtotime returns the timestamp for April 1st for a date like 2011-04-01,today + // but we don't want this, as this is a date range and supposed to throw the exception + strpos($dateString, ',') !== false + || + ($dateString = strtotime($dateString)) === false + )) { throw new Exception(Piwik_TranslateException('General_ExceptionInvalidDateFormat', array("YYYY-MM-DD, or 'today' or 'yesterday'", "strtotime", "http://php.net/strtotime"))); } |