php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57257 php_filter_validate_email()/php_filter_email() Inconsistency
Submitted: 2006-09-23 13:35 UTC Modified: 2016-07-29 23:43 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: chris at dented-planet dot net Assigned: cmb (profile)
Status: Closed Package: Filter related
PHP Version: 5.2.0 OS: Mac OS 10.4.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chris at dented-planet dot net
New email:
PHP Version: OS:

 

 [2006-09-23 13:35 UTC] chris at dented-planet dot net
Description:
------------
While perusing the source code of the Filter extension, I noticed what I believe to be an inconsistency between php_filter_validate_email() and php_filter_email().

php_filter_validate_email() is locale-dependent (via \w in the regexp) for the local-part of an email address.

php_filter_email() is not locale-dependent.

This means that php_filter_validate_email() may allow characters (such as accent characters) that php_filter_email() won't.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-09 15:51 UTC] chris at dented-planet dot net
I'm just checking back and noticed that there has been no reponse to this.

I'm curious- is this a bug or correct behavior?
 [2006-11-09 19:58 UTC] pierre dot php at gmail dot com
Yes, I'm also not sure about this issue. In theory, the sanitizing filters do not validate the format but only clean up the data using a set of allowed characters for a given data type.

Logical filters validate the data and will return false if the format is not respected.

In short, we have read your report but were not sure about the best fix. It was not critical for 5.2.0 but we did not forget it :)
 [2016-07-29 23:43 UTC] cmb@php.net
-Status: Open +Status: Closed -Package: filter +Package: Filter related -Assigned To: +Assigned To: cmb
 [2016-07-29 23:43 UTC] cmb@php.net
PECL/filter has been superseeded by ext/filter, so this issue
would affect FILTER_VALIDATE_EMAIL vs. FILTER_SANITIZE_EMAIL, but
it has already been resolved at least as of PHP 5.2.17, see
<https://github.com/php/php-src/blob/PHP-5.2/ext/filter/logical_filters.c#L525>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC