From c34d2b91dad13d793baf94180457a935e04a9526 Mon Sep 17 00:00:00 2001 From: foobar Date: Wed, 4 Apr 2001 20:46:26 +0000 Subject: Added new configuration directives: arg_separator.input and arg_separator.output --- main/php_variables.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'main/php_variables.c') diff --git a/main/php_variables.c b/main/php_variables.c index 1d2ff0c21f..dd7f6f7bb2 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -217,7 +217,7 @@ SAPI_POST_HANDLER_FUNC(php_std_post_handler) void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC) { - char *res = NULL, *var, *val, *separator = ";&"; + char *res = NULL, *var, *val, *separator=NULL; const char *c_var; pval *array_ptr; int free_buffer=0; @@ -238,7 +238,6 @@ void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC) PG(http_globals)[TRACK_VARS_GET] = array_ptr; break; case PARSE_COOKIE: - separator=";"; PG(http_globals)[TRACK_VARS_COOKIE] = array_ptr; break; } @@ -278,6 +277,16 @@ void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC) return; } + switch (arg) { + case PARSE_GET: + case PARSE_STRING: + separator = (char *) estrdup(PG(arg_separator).input); + break; + case PARSE_COOKIE: + separator = ";\0"; + break; + } + var = php_strtok_r(res, separator, &strtok_buf); while (var) { @@ -292,6 +301,11 @@ void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC) } var = php_strtok_r(NULL, separator, &strtok_buf); } + + if(arg != PARSE_COOKIE) { + efree(separator); + } + if (free_buffer) { efree(res); } -- cgit v1.2.1