diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index b0434f2e43223..d6464317c3df1 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -173,9 +173,7 @@ PHP_FUNCTION(apache_request_headers) const apr_array_header_t *arr; char *key, *val; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -196,9 +194,7 @@ PHP_FUNCTION(apache_response_headers) const apr_array_header_t *arr; char *key, *val; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -243,13 +239,13 @@ PHP_FUNCTION(apache_note) /* {{{ Set an Apache subprocess_env variable */ /* - * XXX this doesn't look right. shouldn't it be the parent ?*/ + */ PHP_FUNCTION(apache_setenv) { php_struct *ctx; char *variable=NULL, *string_val=NULL; size_t variable_len, string_val_len; - bool walk_to_top = 0; + bool walk_to_top = false; int arg_count = ZEND_NUM_ARGS(); request_rec *r; @@ -262,8 +258,8 @@ PHP_FUNCTION(apache_setenv) r = ctx->r; if (arg_count == 3) { if (walk_to_top) { - while(r->prev) { - r = r->prev; + if (r->main) { + r = r->main; } } } @@ -276,14 +272,13 @@ PHP_FUNCTION(apache_setenv) /* {{{ Get an Apache subprocess_env variable */ /* - * XXX: shouldn't this be the parent not the 'prev' */ PHP_FUNCTION(apache_getenv) { php_struct *ctx; char *variable; size_t variable_len; - bool walk_to_top = 0; + bool walk_to_top = false; int arg_count = ZEND_NUM_ARGS(); char *env_val=NULL; request_rec *r; @@ -297,8 +292,8 @@ PHP_FUNCTION(apache_getenv) r = ctx->r; if (arg_count == 2) { if (walk_to_top) { - while(r->prev) { - r = r->prev; + if (r->main) { + r = r->main; } } }