summaryrefslogtreecommitdiffstats
path: root/system/helpers/date_helper.php
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2013-05-18 16:18:17 +0200
committerRasmus Lerdorf <rasmus@php.net>2013-05-18 16:43:10 +0200
commit4ad89d8ec569b5589ca06ab61feaac203dbfe3da (patch)
treede0ea333e6c3facb3fe0f5d2d5fbfdb4ef0606f2 /system/helpers/date_helper.php
parentd4d80223ccef8fd3606f3a89d33afbfe95226bd8 (diff)
The date_range() function is a bit broken
Neither $unix_time nor $start_date were defined here Signed-off-by: Rasmus Lerdorf <rasmus@php.net>
Diffstat (limited to 'system/helpers/date_helper.php')
-rw-r--r--system/helpers/date_helper.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 41a7ab635..599e86a57 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -677,7 +677,7 @@ if ( ! function_exists('date_range'))
$is_unix = ! ( ! $is_unix OR $is_unix === 'days');
// Validate input and try strtotime() on invalid timestamps/intervals, just in case
- if ( ( ! ctype_digit((string) $unix_start) && ($unix_start = @strtotime($unix_time)) === FALSE)
+ if ( ( ! ctype_digit((string) $unix_start) && ($unix_start = @strtotime($unix_start)) === FALSE)
OR ( ! ctype_digit((string) $mixed) && ($is_unix === FALSE OR ($mixed = @strtotime($mixed)) === FALSE))
OR ($is_unix === TRUE && $mixed < $unix_start))
{
@@ -686,7 +686,7 @@ if ( ! function_exists('date_range'))
if ($is_unix && ($unix_start == $mixed OR date($format, $unix_start) === date($format, $mixed)))
{
- return array($start_date);
+ return array(date($format, $unix_start));
}
$range = array();
@@ -780,4 +780,4 @@ if ( ! function_exists('date_range'))
}
/* End of file date_helper.php */
-/* Location: ./system/helpers/date_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/date_helper.php */