From 33b43d710f34c1111b5f4e78ee6f57829d70acd8 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 15 Oct 2009 12:26:54 +0000 Subject: [PATCH] Fixed bug #49855 (import_request_variables() always returns NULL). --- NEWS | 2 ++ ext/standard/basic_functions.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 02b0a0470f..eb0fe5b0b9 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS - Fixed crash when instantiating PDORow and PDOStatement through Reflection. (Felipe) +- Fixed bug #49855 (import_request_variables() always returns NULL). (Ilia, + sjoerd at php dot net) - Fixed bug #49847 (exec() fails to return data inside 2nd parameter, given output lines >4095 bytes). (Ilia) - Fixed bug #49809 (time_sleep_until() is not available on OpenSolaris). (Jani) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 0e4eb0b6af..8f89dc022b 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -6392,6 +6392,7 @@ PHP_FUNCTION(import_request_variables) char *types, *prefix; uint prefix_len; char *p; + zend_bool ok = 0; switch (ZEND_NUM_ARGS()) { @@ -6429,20 +6430,24 @@ PHP_FUNCTION(import_request_variables) case 'g': case 'G': zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]), (apply_func_args_t) copy_request_variable, 2, prefix, prefix_len); + ok = 1; break; case 'p': case 'P': zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]), (apply_func_args_t) copy_request_variable, 2, prefix, prefix_len); zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_FILES]), (apply_func_args_t) copy_request_variable, 2, prefix, prefix_len); + ok = 1; break; case 'c': case 'C': zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]), (apply_func_args_t) copy_request_variable, 2, prefix, prefix_len); + ok = 1; break; } } + RETURN_BOOL(ok); } /* }}} */ -- 2.40.0