pajoye          Sat Jul 29 01:27:47 2006 UTC

  Modified files:              
    /php-src/ext/filter logical_filters.c package.xml 
    /php-src/ext/filter/tests   bug8315.phpt 
  Log:
  - MFH: #8315, NULL character stops the validation
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.4 
php-src/ext/filter/logical_filters.c:1.5
--- php-src/ext/filter/logical_filters.c:1.4    Sat Jul 22 12:54:05 2006
+++ php-src/ext/filter/logical_filters.c        Sat Jul 29 01:27:47 2006
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: logical_filters.c,v 1.4 2006/07/22 12:54:05 nlopess Exp $ */
+/* $Id: logical_filters.c,v 1.5 2006/07/29 01:27:47 pajoye Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -119,6 +119,7 @@
                }
                i++;
                p[i] = '\0';
+               end = p + i - 1;
        }
 
        /* state 0 */
@@ -189,7 +190,7 @@
        }
 
 stateT: /* state "tail" */
-       if (*p != '\0') {
+       if (*p != '\0' || (p-1) != end) {
                goto stateE;
        } else {
                goto stateR;
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/package.xml?r1=1.23&r2=1.24&diff_format=u
Index: php-src/ext/filter/package.xml
diff -u php-src/ext/filter/package.xml:1.23 php-src/ext/filter/package.xml:1.24
--- php-src/ext/filter/package.xml:1.23 Thu Jul 20 13:08:36 2006
+++ php-src/ext/filter/package.xml      Sat Jul 29 01:27:47 2006
@@ -26,10 +26,11 @@
     <state>beta</state>
     <version>0.10.0</version>
     <date>2006-05-14</date>
-    <notes>- Fixed PECL bug #6136, ini_set should not be able to change the 
filter.default (Pierre)
-- Fixed PECL bug #6639: uppercase hexadecimal digits are not supported
+    <notes>- Fixed PECL bug #8315, NULL character stops the validation (Pierre)
 - Fixed PECL bug #7733, Float exponential weird result (Pierre)
 - Fixed PECL bug #7715, Input_get float error (Pierre)
+- Fixed PECL bug #6639: uppercase hexadecimal digits are not supported
+- Fixed PECL bug #6136, ini_set should not be able to change the 
filter.default (Pierre)
 - Implemented PECL req #6641: negative values for hexadecimal and octal 
numbers are not supported.
 - Added support for php pcre expressions (Pierre)
 - Fixed Possible leak in internal sapi_filter (Pierre)
@@ -37,7 +38,7 @@
 - Added FILTER_FLAG_SCALAR and FILTER_FLAG_ARRAY , allows or not array values 
(Pierre)
 - Basic IPv6 (no option yet, only the syntax is verified) (Pierre)
 - Add support for custom decimal separator (Pierre)
-- Integer, boolean and float filters trim the values before the validations 
(spaces only) (Pierre)
+- INT and Float filters trim the values before the validations (spaces only) 
(Pierre)
 - input_get and input_get_args returns now FALSE when the validation failed
   and NULL when the variable has not been found (Pierre)
 - Added JIT support
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/bug8315.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/filter/tests/bug8315.phpt
diff -u /dev/null php-src/ext/filter/tests/bug8315.phpt:1.2
--- /dev/null   Sat Jul 29 01:27:47 2006
+++ php-src/ext/filter/tests/bug8315.phpt       Sat Jul 29 01:27:47 2006
@@ -0,0 +1,10 @@
+--TEST--
+bug 8315, NULL values halt the validation 
+--FILE--
+<?php
+
+$var="3".chr(0)."foo";
+var_dump(filter_data($var, FILTER_VALIDATE_INT));
+?>
+--EXPECTF--    
+bool(false)

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

Reply via email to