lbarnaud                Sun Nov  2 22:22:44 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/filter/tests   bug42718-2.phpt bug42718.phpt 

  Modified files:              
    /php-src/ext/filter filter.c 
  Log:
  MFH: Fixed bug #42718 (FILTER_UNSAFE_RAW not applied when configured as
  default filter)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.52.2.39.2.9&r2=1.52.2.39.2.10&diff_format=u
Index: php-src/ext/filter/filter.c
diff -u php-src/ext/filter/filter.c:1.52.2.39.2.9 
php-src/ext/filter/filter.c:1.52.2.39.2.10
--- php-src/ext/filter/filter.c:1.52.2.39.2.9   Sun Nov  2 21:19:31 2008
+++ php-src/ext/filter/filter.c Sun Nov  2 22:22:43 2008
@@ -19,7 +19,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: filter.c,v 1.52.2.39.2.9 2008/11/02 21:19:31 felipe Exp $ */
+/* $Id: filter.c,v 1.52.2.39.2.10 2008/11/02 22:22:43 lbarnaud Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -319,7 +319,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_row( 2, "Input Validation and Filtering", 
"enabled" );
-       php_info_print_table_row( 2, "Revision", "$Revision: 1.52.2.39.2.9 $");
+       php_info_print_table_row( 2, "Revision", "$Revision: 1.52.2.39.2.10 $");
        php_info_print_table_end();
 
        DISPLAY_INI_ENTRIES();
@@ -447,7 +447,7 @@
                Z_STRLEN(new_var) = val_len;
                Z_TYPE(new_var) = IS_STRING;
 
-               if (!(IF_G(default_filter) == FILTER_UNSAFE_RAW)) {
+               if (IF_G(default_filter) != FILTER_UNSAFE_RAW || 
IF_G(default_filter_flags) != 0) {
                        zval *tmp_new_var = &new_var;
                        Z_STRVAL(new_var) = estrndup(*val, val_len);
                        INIT_PZVAL(tmp_new_var);

http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/bug42718-2.phpt?view=markup&rev=1.1
Index: php-src/ext/filter/tests/bug42718-2.phpt
+++ php-src/ext/filter/tests/bug42718-2.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/bug42718.phpt?view=markup&rev=1.1
Index: php-src/ext/filter/tests/bug42718.phpt
+++ php-src/ext/filter/tests/bug42718.phpt
--TEST--
Bug #42718 (unsafe_raw filter not applied when configured as default filter)
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--INI--
magic_quotes_gpc=0
filter.default=unsafe_raw
filter.default_flags=4
--GET--
a=1%00
--FILE--
<?php
echo ini_get('filter.default') . "\n";
echo ini_get('filter.default_flags') . "\n";
var_dump(FILTER_FLAG_STRIP_LOW == 4);
echo addcslashes($_GET['a'],"\0") . "\n";
?>
--EXPECT--
unsafe_raw
4
bool(true)
1



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to