diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2004-07-28 01:44:39 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2004-07-28 01:44:39 +0000 |
commit | 89989f4e62e511fc6a6556d867baccd20f9ec7fd (patch) | |
tree | 52d56031800c1b20516d8b9edf5990a0c2ca1026 | |
parent | 0b40c1d82b1c194f0463bb83fee9a15c8661f840 (diff) | |
download | php-git-89989f4e62e511fc6a6556d867baccd20f9ec7fd.tar.gz |
Fixed bug #29342 (strtotime() does not handle empty date string properly).
-rw-r--r-- | ext/standard/datetime.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 4e455a86a0..694668198d 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -1080,8 +1080,10 @@ PHP_FUNCTION(strtotime) } convert_to_string_ex(z_time); - if (Z_STRLEN_PP(z_time) == 0) - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Called with empty time parameter"); + if (!Z_STRLEN_PP(z_time)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Called with an empty time parameter."); + RETURN_LONG(-1); + } if (argc == 2) { convert_to_long_ex(z_now); now = Z_LVAL_PP(z_now); |