]> granicus.if.org Git - php/commitdiff
MFH:
authorAntony Dovgal <tony2001@php.net>
Thu, 22 Jun 2006 18:44:31 +0000 (18:44 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 22 Jun 2006 18:44:31 +0000 (18:44 +0000)
don't try to parse empty string, return false immediately
(fixes off-by-one)

ext/date/php_date.c

index 18c0f32b579af5a62ed489846874b436e4ff1b35..c9c5d26da8f382ced75391d1c8f052d750be8445 100644 (file)
@@ -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) {