[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c /ext/filter/tests 016.phpt

2009-07-06 Thread Ilia Alshanetsky
iliaa   Tue Jul  7 00:44:20 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/filter logical_filters.c 
/php-src/ext/filter/tests   016.phpt 
  Log:
  
  MFB: Fixed bug #48808 (FILTER_VALIDATE_EMAIL allows some invalid e-mail
  syntaxes)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.13&r2=1.1.2.22.2.14&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.13 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.14
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.13  Sun Jul  5 16:08:05 2009
+++ php-src/ext/filter/logical_filters.cTue Jul  7 00:44:20 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.13 2009/07/05 16:08:05 iliaa Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.14 2009/07/07 00:44:20 iliaa Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -472,7 +472,7 @@
 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
/* From 
http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */
-   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?(\\.(?=[A-Za-z0-9\\-]))?)+[A-Za-z\\-]*))$/D";
+   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_][A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?(\\.(?=[A-Za-z0-9\\-]))?)+[A-Za-z]+))$/D";
 
pcre   *re = NULL;
pcre_extra *pcre_extra = NULL;
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/016.phpt?r1=1.4.2.4.2.2&r2=1.4.2.4.2.3&diff_format=u
Index: php-src/ext/filter/tests/016.phpt
diff -u php-src/ext/filter/tests/016.phpt:1.4.2.4.2.2 
php-src/ext/filter/tests/016.phpt:1.4.2.4.2.3
--- php-src/ext/filter/tests/016.phpt:1.4.2.4.2.2   Sun Jul  5 16:08:05 2009
+++ php-src/ext/filter/tests/016.phpt   Tue Jul  7 00:44:20 2009
@@ -15,7 +15,11 @@
 '[]()/@example.com',   
 'qwertyuiopasdfghjklzxcv...@qwertyuiopasdfghjklzxcvbnm.net',
 'e.x.a.m.p.l...@example.com',
-'firstname.lastn...@employee.2something.com'
+'firstname.lastn...@employee.2something.com',
+'-...@foo.com',
+'f...@-.com',
+'f...@bar.123',
+'f...@bar.-'
 );
 foreach ($values as $value) {
var_dump(filter_var($value, FILTER_VALIDATE_EMAIL));
@@ -35,4 +39,8 @@
 string(57) "qwertyuiopasdfghjklzxcv...@qwertyuiopasdfghjklzxcvbnm.net"
 string(26) "e.x.a.m.p.l...@example.com"
 string(42) "firstname.lastn...@employee.2something.com"
-Done
\ No newline at end of file
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+Done



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c /ext/filter/tests bug46973.phpt

2009-06-10 Thread Felipe Pena
felipe  Wed Jun 10 19:01:17 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/filter logical_filters.c 
/php-src/ext/filter/tests   bug46973.phpt 
  Log:
  - MFH: Fix the fix (Bug #46973 - IPv6 address filter rejects valid address)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.11&r2=1.1.2.22.2.12&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.11 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.12
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.11  Tue Mar 31 11:22:08 2009
+++ php-src/ext/filter/logical_filters.cWed Jun 10 19:01:17 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.11 2009/03/31 11:22:08 mattwil Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.12 2009/06/10 19:01:17 felipe Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -570,7 +570,7 @@
}
if (*str == ':') {
if (compressed || --blocks == 0) {
-   return ipv4 != NULL;
+   return 0;
}   
if (++str == end || (ipv4 && ipv4 == str)) {
return 1;
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/bug46973.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/filter/tests/bug46973.phpt
diff -u php-src/ext/filter/tests/bug46973.phpt:1.1.2.2 
php-src/ext/filter/tests/bug46973.phpt:1.1.2.3
--- php-src/ext/filter/tests/bug46973.phpt:1.1.2.2  Wed Dec 31 15:03:18 2008
+++ php-src/ext/filter/tests/bug46973.phpt  Wed Jun 10 19:01:17 2009
@@ -9,6 +9,6 @@
  
 ?>
 --EXPECTF--
-string(28) "1fff::a88:85a3::172.31.128.1"
+bool(false)
 string(39) "3ffe:6a88:85a3:08d3:1319:8a2e:0370:7344"
-string(28) "1fff::a88:85a3::172.31.128.1"
+bool(false)



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c

2009-03-31 Thread Matt Wilmas
mattwil Tue Mar 31 11:22:08 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/filter logical_filters.c 
  Log:
  - MFH: Removed unused LONG_SIGN_MASK definition, and a stray \
- Changed sign flag to int (it's no longer being used in a calculation)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.10&r2=1.1.2.22.2.11&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.10 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.11
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.10  Tue Mar 31 10:02:39 2009
+++ php-src/ext/filter/logical_filters.cTue Mar 31 11:22:08 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.10 2009/03/31 10:02:39 dmitry Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.11 2009/03/31 11:22:08 mattwil Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -30,8 +30,6 @@
 # include 
 #endif
 
-#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
-
 #ifndef INADDR_NONE
 # define INADDR_NONE ((unsigned long int) -1)
 #endif
@@ -70,7 +68,7 @@
 
 static int php_filter_parse_int(const char *str, unsigned int str_len, long 
*ret TSRMLS_DC) { /* {{{ */
long ctx_value;
-   long sign = 0;
+   int sign = 0;
const char *end = str + str_len;
 
switch (*str) {
@@ -97,7 +95,7 @@
 
while (str < end) {
if (*str >= '0' && *str <= '9') {
-   ctx_value = (ctx_value * 10) + (*(str++) - '0');
\
+   ctx_value = (ctx_value * 10) + (*(str++) - '0');
} else {
return -1;
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c

2009-03-25 Thread Ilia Alshanetsky
iliaa   Wed Mar 25 18:51:45 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/filter logical_filters.c 
  Log:
  
  Fixed bug #47772 (FILTER_VALIDATE_EMAIL allows f...@bar. addresses)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.8&r2=1.1.2.22.2.9&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.8 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.9
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.8   Sun Mar  8 18:21:15 2009
+++ php-src/ext/filter/logical_filters.cWed Mar 25 18:51:44 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.8 2009/03/08 18:21:15 iliaa Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.9 2009/03/25 18:51:44 iliaa Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -469,7 +469,7 @@
 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
/* From 
http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */
-   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?\\.?)+[A-Za-z\\-]*))$/D";
+   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?(\\.(?=[A-Za-z\\-]))?)+[A-Za-z\\-]*))$/D";
 
pcre   *re = NULL;
pcre_extra *pcre_extra = NULL;



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c

2009-03-08 Thread Ilia Alshanetsky
iliaa   Sun Mar  8 18:21:15 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/filter logical_filters.c 
  Log:
  Fixed bug #47598 (FILTER_VALIDATE_EMAIL is locale aware)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.7&r2=1.1.2.22.2.8&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.7 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.8
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.7   Mon Feb 23 16:52:29 2009
+++ php-src/ext/filter/logical_filters.cSun Mar  8 18:21:15 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.7 2009/02/23 16:52:29 iliaa Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.8 2009/03/08 18:21:15 iliaa Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -469,7 +469,7 @@
 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
/* From 
http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */
-   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?\\.?)+[A-Za-z\\-]*))$/D";
+   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?\\.?)+[A-Za-z\\-]*))$/D";
 
pcre   *re = NULL;
pcre_extra *pcre_extra = NULL;



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c

2009-02-23 Thread Ilia Alshanetsky
iliaa   Mon Feb 23 16:52:30 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/filter logical_filters.c 
  Log:
  Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6
  addresses in the filter extension)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.6&r2=1.1.2.22.2.7&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.6 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.7
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.6   Mon Feb  2 23:50:31 2009
+++ php-src/ext/filter/logical_filters.cMon Feb 23 16:52:29 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.6 2009/02/02 23:50:31 iliaa Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.7 2009/02/23 16:52:29 iliaa Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -655,6 +655,12 @@
if (res < 1) {
RETURN_VALIDATION_FAILED
}
+   /* Check flags */
+   if (flags & FILTER_FLAG_NO_PRIV_RANGE) {
+   if (Z_STRLEN_P(value) >=2 && 
(!strncasecmp("FC", Z_STRVAL_P(value), 2) || !strncasecmp("FD", 
Z_STRVAL_P(value), 2))) {
+   RETURN_VALIDATION_FAILED
+   }
+   }
}
break;
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c /ext/filter/tests 016.phpt

2009-02-02 Thread Ilia Alshanetsky
iliaa   Mon Feb  2 23:50:31 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/filter logical_filters.c 
/php-src/ext/filter/tests   016.phpt 
  Log:
  
  Fixed bug #47282 (FILTER_VALIDATE_EMAIL is marking valid email addresses as
  invalid)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.5&r2=1.1.2.22.2.6&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.5 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.6
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.5   Wed Dec 31 15:03:18 2008
+++ php-src/ext/filter/logical_filters.cMon Feb  2 23:50:31 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.5 2008/12/31 15:03:18 felipe Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.6 2009/02/02 23:50:31 iliaa Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -469,7 +469,7 @@
 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
/* From 
http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */
-   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?\\.)+[A-Za-z\\-]+))$/D";
+   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?\\.?)+[A-Za-z\\-]*))$/D";
 
pcre   *re = NULL;
pcre_extra *pcre_extra = NULL;
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/016.phpt?r1=1.4.2.4&r2=1.4.2.4.2.1&diff_format=u
Index: php-src/ext/filter/tests/016.phpt
diff -u php-src/ext/filter/tests/016.phpt:1.4.2.4 
php-src/ext/filter/tests/016.phpt:1.4.2.4.2.1
--- php-src/ext/filter/tests/016.phpt:1.4.2.4   Tue Dec 19 14:16:23 2006
+++ php-src/ext/filter/tests/016.phpt   Mon Feb  2 23:50:31 2009
@@ -13,7 +13,8 @@
 't...@com',
 '@',   
 '[]()/@example.com',   
-'qwertyuiopasdfghjklzxcv...@qwertyuiopasdfghjklzxcvbnm.net',   
+'qwertyuiopasdfghjklzxcv...@qwertyuiopasdfghjklzxcvbnm.net',
+'e.x.a.m.p.l...@example.com'
 );
 foreach ($values as $value) {
var_dump(filter_var($value, FILTER_VALIDATE_EMAIL));
@@ -27,8 +28,9 @@
 bool(false)
 bool(false)
 bool(false)
-bool(false)
+string(8) "t...@com"
 bool(false)
 bool(false)
 string(57) "qwertyuiopasdfghjklzxcv...@qwertyuiopasdfghjklzxcvbnm.net"
-Done
+string(26) "e.x.a.m.p.l...@example.com"
+Done
\ No newline at end of file



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c /ext/filter/tests bug46973.phpt

2008-12-31 Thread Felipe Pena
felipe  Wed Dec 31 15:03:18 2008 UTC

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

  Modified files:  
/php-src/ext/filter logical_filters.c 
  Log:
  - MFH: Fixed bug #46973 (IPv6 address filter rejects valid address)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.4&r2=1.1.2.22.2.5&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.4 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.5
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.4   Wed Dec 31 11:15:36 2008
+++ php-src/ext/filter/logical_filters.cWed Dec 31 15:03:18 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.4 2008/12/31 11:15:36 sebastian Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.5 2008/12/31 15:03:18 felipe Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -526,7 +526,7 @@
int compressed = 0;
int blocks = 8;
int n;
-   char *ipv4;
+   char *ipv4 = NULL;
char *end;
int ip4elm[4];
char *s = str;
@@ -552,20 +552,24 @@
blocks = 6;
}
 
-   end = str + str_len;
+   end = ipv4 ? ipv4 : str + str_len;
+
while (str < end) {
if (*str == ':') {
if (--blocks == 0) {
+   if ((str+1) == end && ipv4) {
+   return 1;
+   }
return 0;
}   
if (++str >= end) {
-   return 0;
+   return (ipv4 && ipv4 == str && blocks == 3) || 
0;
}
if (*str == ':') {
if (compressed || --blocks == 0) {
-   return 0;
+   return ipv4 != NULL;
}   
-   if (++str == end) {
+   if (++str == end || (ipv4 && ipv4 == str)) {
return 1;
}
compressed = 1;

http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/bug46973.phpt?view=markup&rev=1.1
Index: php-src/ext/filter/tests/bug46973.phpt
+++ php-src/ext/filter/tests/bug46973.phpt
--TEST--
Bug #46973 (IPv6 address filter rejects valid address)
--FILE--

--EXPECTF--
string(28) "1fff::a88:85a3::172.31.128.1"
string(39) "3ffe:6a88:85a3:08d3:1319:8a2e:0370:7344"
string(28) "1fff::a88:85a3::172.31.128.1"



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c

2008-10-21 Thread Ilia Alshanetsky

Derick,

I made 3 commits, 5.2, 5.3, and 6.

What's the problem?


On 21-Oct-08, at 3:46 AM, Derick Rethans wrote:


On Mon, 20 Oct 2008, Ilia Alshanetsky wrote:


iliaa   Mon Oct 20 23:22:46 2008 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/filter  logical_filters.c
 Log:
 Fixed bug #46343 (IPv6 address filter accepts invalid address)


How often do we need to ask to also commit to HEAD? You're making it a
pain to keep things in sync. If you don't want to commit to HEAD,  
don't

bother committing to the other branches either.

regards,
Derick
--
HEAD before 5_3!: http://tinyurl.com/6d2esb
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

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



Ilia Alshanetsky





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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c

2008-10-21 Thread Derick Rethans
On Mon, 20 Oct 2008, Ilia Alshanetsky wrote:

> iliaa Mon Oct 20 23:22:46 2008 UTC
> 
>   Modified files:  (Branch: PHP_5_3)
> /php-src/ext/filter   logical_filters.c 
>   Log:
>   Fixed bug #46343 (IPv6 address filter accepts invalid address)

How often do we need to ask to also commit to HEAD? You're making it a 
pain to keep things in sync. If you don't want to commit to HEAD, don't 
bother committing to the other branches either.

regards,
Derick
-- 
HEAD before 5_3!: http://tinyurl.com/6d2esb
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c

2008-10-20 Thread Ilia Alshanetsky
iliaa   Mon Oct 20 23:22:46 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/filter logical_filters.c 
  Log:
  Fixed bug #46343 (IPv6 address filter accepts invalid address)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.2&r2=1.1.2.22.2.3&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.2 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.3
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.2   Tue Mar 18 23:31:34 2008
+++ php-src/ext/filter/logical_filters.cMon Oct 20 23:22:45 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.2 2008/03/18 23:31:34 iliaa Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.3 2008/10/20 23:22:45 iliaa Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -529,6 +529,7 @@
char *ipv4;
char *end;
int ip4elm[4];
+   char *s = str;
 
if (!memchr(str, ':', str_len)) {
return 0;
@@ -568,6 +569,8 @@
return 1;
}
compressed = 1;
+   } else if ((str - 1) == s) {
+   return 0;
}   
}
n = 0;



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/filter logical_filters.c /ext/filter/tests bug44445.phpt

2008-03-18 Thread Ilia Alshanetsky
iliaa   Tue Mar 18 23:31:34 2008 UTC

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

  Modified files:  
/php-src/ext/filter logical_filters.c 
  Log:
  
  Fixed bug #5 (email validator does not handle domains
  starting/ending with a -) 
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.22.2.1&r2=1.1.2.22.2.2&diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.1.2.22.2.1 
php-src/ext/filter/logical_filters.c:1.1.2.22.2.2
--- php-src/ext/filter/logical_filters.c:1.1.2.22.2.1   Mon Dec 31 07:17:08 2007
+++ php-src/ext/filter/logical_filters.cTue Mar 18 23:31:34 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.1.2.22.2.1 2007/12/31 07:17:08 sebastian Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22.2.2 2008/03/18 23:31:34 iliaa Exp $ */
 
 #include "php_filter.h"
 #include "filter_private.h"
@@ -469,7 +469,7 @@
 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
/* From 
http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */
-   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\\-])+\\.)+[A-Za-z\\-]+))$/D";
+   const char regexp[] = 
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?\\.)+[A-Za-z\\-]+))$/D";
 
pcre   *re = NULL;
pcre_extra *pcre_extra = NULL;

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



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