php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79802 VALIDATE_EMAIL has another behaviour as SANITIZE_EMAIL
Submitted: 2020-07-07 07:20 UTC Modified: -
From: cyberline@php.net Assigned:
Status: Open Package: Filter related
PHP Version: Irrelevant OS: Debian 10.4
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: cyberline@php.net
New email:
PHP Version: OS:

 

 [2020-07-07 07:20 UTC] cyberline@php.net
Description:
------------
In all PHP Versions except 5.3.2 the following Script will return false for FILTER_VALIDATE_EMAIL while FILTER_SANITIZE_EMAIL does NOTHING to the input email.

While the Provided email is a valid return path, i excpect that VALIDATE_EMAIL will return the string provided and not false.

Test script:
---------------
<?php

$email = '3e9.1c.4UB2NC76N436-3SP03.test-EW3LBM-M6H4BG-0-1.mobil.123456.989=test.de@smtp20.test.com';
var_dump(\filter_var($email, FILTER_VALIDATE_EMAIL));
var_dump($email === \filter_var($email, FILTER_SANITIZE_EMAIL));

Expected result:
----------------
string(89) "3e9.1c.4UB2NC76N436-3SP03.test-EW3LBM-M6H4BG-0-1.mobil.123456.989=test.de@smtp20.test.com"
bool(true)

Actual result:
--------------
bool(false)
bool(true)

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 15:01:27 2020 UTC