summaryrefslogtreecommitdiff
path: root/ext/standard/datetime.c
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2000-06-14 20:31:31 +0000
committerRasmus Lerdorf <rasmus@php.net>2000-06-14 20:31:31 +0000
commitf38e760c396af1a9617764fb85c03abb8637001a (patch)
treec5f9f78dbb66aedd6b2cf54faf26f7e33c66e3f3 /ext/standard/datetime.c
parent7565347ba00689fe2429623b595ff6ffa9589e93 (diff)
downloadphp-git-f38e760c396af1a9617764fb85c03abb8637001a.tar.gz
Refine checkdate() fix to accept numeric strings and floating point as well
Diffstat (limited to 'ext/standard/datetime.c')
-rw-r--r--ext/standard/datetime.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index b856480c0d..30f0aa7778 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -595,14 +595,18 @@ char *php_std_date(time_t t)
PHP_FUNCTION(checkdate)
{
pval **month, **day, **year;
- int m, d, y;
+ int m, d, y, res=0;
if (ZEND_NUM_ARGS() != 3 ||
zend_get_parameters_ex(3, &month, &day, &year) == FAILURE) {
WRONG_PARAM_COUNT;
}
- if((*year)->type != IS_LONG) {
- RETURN_FALSE;
+
+ if((*year)->type == IS_STRING) {
+ res = is_numeric_string((*year)->value.str.val, (*year)->value.str.len, NULL, NULL);
+ if(res!=IS_LONG && res !=IS_DOUBLE) {
+ RETURN_FALSE;
+ }
}
convert_to_long_ex(day);
convert_to_long_ex(month);