]> granicus.if.org Git - php/commitdiff
Correct handling of the UNSAFE_RAW filter
authorRasmus Lerdorf <rasmus@php.net>
Thu, 19 May 2005 21:08:04 +0000 (21:08 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Thu, 19 May 2005 21:08:04 +0000 (21:08 +0000)
ext/filter/filter.c

index 7f0737b33b791dc88afd55c8f127e7378dd5a560..b68885ac44769392e6ca517edc4e32a00da50163 100644 (file)
@@ -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
 }
 /* }}} */