lbarnaud                Sun Nov  2 22:04:41 2008 UTC

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

  Modified files:              
    /php-src    NEWS 
    /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/NEWS?r1=1.2027.2.547.2.1291&r2=1.2027.2.547.2.1292&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1291 php-src/NEWS:1.2027.2.547.2.1292
--- php-src/NEWS:1.2027.2.547.2.1291    Sun Nov  2 14:12:15 2008
+++ php-src/NEWS        Sun Nov  2 22:04:40 2008
@@ -26,6 +26,8 @@
 - Fixed bug #43452 (strings containing a weekday, or a number plus weekday
   behaved incorrect of the current day-of-week was the same as the one in the
   phrase).(Derick)
+- Fixed bug #42718 (FILTER_UNSAFE_RAW not applied when configured as default
+  filter). (Arnaud)
 - Fixed bug #42294 (Unified solution for round() based on C99 round). (Ilia)
 
 - Fixed ability to use "internal" heaps in extensions. (Arnaud, Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.52.2.42&r2=1.52.2.43&diff_format=u
Index: php-src/ext/filter/filter.c
diff -u php-src/ext/filter/filter.c:1.52.2.42 
php-src/ext/filter/filter.c:1.52.2.43
--- php-src/ext/filter/filter.c:1.52.2.42       Sun Feb 24 18:34:30 2008
+++ php-src/ext/filter/filter.c Sun Nov  2 22:04:40 2008
@@ -19,7 +19,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: filter.c,v 1.52.2.42 2008/02/24 18:34:30 felipe Exp $ */
+/* $Id: filter.c,v 1.52.2.43 2008/11/02 22:04:40 lbarnaud Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -275,7 +275,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.42 $");
+       php_info_print_table_row( 2, "Revision", "$Revision: 1.52.2.43 $");
        php_info_print_table_end();
 
        DISPLAY_INI_ENTRIES();
@@ -403,7 +403,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