From: Johannes Schlüter Date: Wed, 27 Jan 2010 17:22:54 +0000 (+0000) Subject: merge r293051: Fixed bug #50632 (filter_input() does not return default value if X-Git-Tag: php-5.3.2RC2~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96107ed2ca4f1a97daa68028e6c89134bd93c1d0;p=php merge r293051: Fixed bug #50632 (filter_input() does not return default value if the variable does not exist) (iliaa) --- diff --git a/NEWS b/NEWS index eaed0270c9..d15b9dce26 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ PHP NEWS (Ilia) - Added stream_resolve_include_path(). (Mikko) +- 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