From e56660a1adafeb4c5d2e6e526aa364f73d3acccb Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Thu, 19 May 2005 21:08:04 +0000 Subject: [PATCH] Correct handling of the UNSAFE_RAW filter --- ext/filter/filter.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 7f0737b33b..b68885ac44 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -194,7 +194,14 @@ unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int val_l assert(*val != NULL); +#if PHP_API_VERSION > 20041224 + if(IF_G(default_filter)==F_UNSAFE_RAW) { + if(new_val_len) *new_val_len = val_len; + return 1; + } +#else if(IF_G(default_filter)==F_UNSAFE_RAW) return(val_len); +#endif switch(arg) { case PARSE_GET: @@ -278,8 +285,10 @@ unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int val_l *val = out; #if PHP_API_VERSION > 20041224 if(new_val_len) *new_val_len = out_len?out_len-1:0; -#endif + return 1; +#else return(out_len?out_len-1:0); +#endif } /* }}} */ -- 2.50.1