summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2010-01-03 22:58:37 +0000
committerIlia Alshanetsky <iliaa@php.net>2010-01-03 22:58:37 +0000
commit299c4c43ed44604ebbf2c1d153bad7f4737e8d0c (patch)
treedf2c2e78fe8818375a60b1dc180f47501de40ace
parent614fd65795468be21901581e2962510620fcf5b4 (diff)
downloadphp-git-299c4c43ed44604ebbf2c1d153bad7f4737e8d0c.tar.gz
Fixed bug #50632 (filter_input() does not return default value if the variable does not exist)
-rw-r--r--NEWS2
-rw-r--r--ext/filter/filter.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 9a15e47f06..6f4a3f1b7b 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ PHP NEWS
- Fixed bug #50636 (MySQLi_Result sets values before calling constructor).
(Pierrick)
+- Fixed bug #50632 (filter_input() does not return default value if the
+ variable does not exist). (Ilia)
- Fixed bug #48190 (Content-type parameter "boundary" is not case-insensitive
in HTTP uploads). (Ilia)
- Fixed bug #47409 (extract() problem with array containing word "this").
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index 517bf2e4f9..e417e5d9d8 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -768,7 +768,8 @@ PHP_FUNCTION(filter_input)
filter_flags = Z_LVAL_PP(filter_args);
} else if (Z_TYPE_PP(filter_args) == IS_ARRAY && zend_hash_find(HASH_OF(*filter_args), "flags", sizeof("flags"), (void **)&option) == SUCCESS) {
PHP_FILTER_GET_LONG_OPT(option, filter_flags);
- } else if (Z_TYPE_PP(filter_args) == IS_ARRAY &&
+ }
+ if (Z_TYPE_PP(filter_args) == IS_ARRAY &&
zend_hash_find(HASH_OF(*filter_args), "options", sizeof("options"), (void **)&opt) == SUCCESS &&
Z_TYPE_PP(opt) == IS_ARRAY &&
zend_hash_find(HASH_OF(*opt), "default", sizeof("default"), (void **)&def) == SUCCESS