diff options
author | foobar <sniper@php.net> | 2001-04-04 20:46:26 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2001-04-04 20:46:26 +0000 |
commit | c34d2b91dad13d793baf94180457a935e04a9526 (patch) | |
tree | f0d95c5ffd241ac49ce4e08571dafaadcb3c8225 /main/php_variables.c | |
parent | 382e3c5ad664f206e2fbd9ebb4b2685a99e5f9b7 (diff) | |
download | php-git-c34d2b91dad13d793baf94180457a935e04a9526.tar.gz |
Added new configuration directives:
arg_separator.input and arg_separator.output
Diffstat (limited to 'main/php_variables.c')
-rw-r--r-- | main/php_variables.c | 18 |
1 files changed, 16 insertions, 2 deletions
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); } |