From: Ilia Alshanetsky Date: Sun, 8 Mar 2009 18:22:26 +0000 (+0000) Subject: MFB: Fixed bug #47598 (FILTER_VALIDATE_EMAIL is locale aware) X-Git-Tag: php-5.2.10RC1~307 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4c07450d281ddc339f8db93ad516451c91cc728;p=php MFB: Fixed bug #47598 (FILTER_VALIDATE_EMAIL is locale aware) --- diff --git a/NEWS b/NEWS index 7fb5768e31..1c1464016c 100644 --- a/NEWS +++ b/NEWS @@ -3,10 +3,11 @@ PHP NEWS ?? ??? 2009, PHP 5.2.10 - Fixed memory corruptions while reading properties of zip files. (Ilia) -- Fixed bug #47546 (Default value for limit parameter in explode is 0, - not -1). (Kalle) +- Fixed bug #47598 (FILTER_VALIDATE_EMAIL is locale aware). (Ilia) +- Fixed bug #47546 (Default value for limit parameter in explode is 0, not -1). + (Kalle) - Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6 - addresses in the filter extension). (Ilia) + addresses in the filter extension). (Ilia) 26 Feb 2009, PHP 5.2.9 - Changed __call() to be invoked on private/protected method access, similar to diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 6074af0e20..450b5bbbf3 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -469,7 +469,7 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ 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;