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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Mar 28 10:01:26 2024 UTC