From 0e9dbae4f8eff82cd99ced032a6f083c98879bfb 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). --- ext/standard/basic_functions.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a0b999c7b2..03c9704762 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -6167,6 +6167,7 @@ PHP_FUNCTION(import_request_variables) int types_len; zval *prefix = NULL; char *p; + zend_bool ok = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&|z/", &types, &types_len, UG(ascii_conv), &prefix) == FAILURE) { return; @@ -6189,17 +6190,20 @@ PHP_FUNCTION(import_request_variables) case 'g': case 'G': zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix); + ok = 1; break; case 'p': case 'P': zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix); zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_FILES]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix); + ok = 1; break; case 'c': case 'C': zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix); + ok = 1; break; } } @@ -6207,6 +6211,7 @@ PHP_FUNCTION(import_request_variables) if (ZEND_NUM_ARGS() < 2) { zval_ptr_dtor(&prefix); } + RETURN_BOOL(ok); } /* }}} */ -- 2.40.0