diff options
| author | Antony Dovgal <tony2001@php.net> | 2006-06-22 18:44:31 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2006-06-22 18:44:31 +0000 |
| commit | 47b41a5d6c1d78949680e2bbdcd8ad5769f010ba (patch) | |
| tree | a3b89155a4013152ddffb9b45ceec628db171b84 /ext/date/php_date.c | |
| parent | 0d708dc358874eeb892edc934d7a4f66efdabc1a (diff) | |
| download | php-git-47b41a5d6c1d78949680e2bbdcd8ad5769f010ba.tar.gz | |
MFH:
don't try to parse empty string, return false immediately
(fixes off-by-one)
Diffstat (limited to 'ext/date/php_date.c')
| -rw-r--r-- | ext/date/php_date.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 18c0f32b57..c9c5d26da8 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1063,6 +1063,10 @@ PHP_FUNCTION(strtotime) RETURN_FALSE; } + if (!time_len) { + RETURN_FALSE; + } + t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB); error1 = error->error_count; timelib_error_container_dtor(error); @@ -1078,7 +1082,7 @@ PHP_FUNCTION(strtotime) timelib_tzinfo_dtor(t->tz_info); } - timelib_time_dtor(now); + timelib_time_dtor(now); timelib_time_dtor(t); if (error1 || error2) { |
