|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65630 filter_var() return false with german umlauts
Submitted: 2013-09-07 16:16 UTC Modified: 2014-02-19 06:41 UTC
Avg. Score:4.4 ± 0.5
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:5 (100.0%)
From: marvin-wegener at outlook dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.5.3 OS: Windows/Linux
Private report: No CVE-ID: None
 [2013-09-07 16:16 UTC] marvin-wegener at outlook dot com

If I use the following script, the filter_var return always false, but the Domain is possible.

It is possible to fix it, that Domains with ÜÖÄ are exepted?

Thanks you in advance!

Test script:
if(filter_var('example@ö', FILTER_VALIDATE_EMAIL))
	echo 'ok';
	echo 'fail';


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-08 21:42 UTC] cmbecker69 at gmx dot de
Unfortunately, the manual[1] is not explicit about that issue, 
but I assume that FILTER_VALIDATE_EMAIL validates according to
RFC 5322, which does not cater for IDNs.  If so, this might be
regarded as "documentation problem".

This bug report is related to request #65385[2].

[1] <>
[2] <>
 [2013-09-09 04:40 UTC]
-Status: Open +Status: Not a bug
 [2014-02-18 13:53 UTC] strahil at gmail dot com
Actually the problem persist with other filters as well. For example, this URL:örse/Vertrieb/

filter_var($url, FILTER_VALIDATE_URL) would return false, but it's a valid URL.

So this indeed is a bug.
 [2014-02-18 14:13 UTC] cmbecker69 at gmx dot de
According to RFC 3986[1] your example is not a valid URI, because
the path component must not contain an Umlaut; the ö would have to
be percent encoded as %C3%B6 (what is done transparently by modern
browsers). Passing the proper URL to filter_var($url,
FILTER_VALIDATE_URL) has the expected result.

[1] <>
 [2014-02-19 06:41 UTC]
Exactly, use the IDN functions or url_encode.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 05:01:29 2024 UTC