Bug #65630 [Com]: filter_var() return false with german umlauts

From: Date: Tue, 18 Feb 2014 13:53:57 +0000
Subject: Bug #65630 [Com]: filter_var() return false with german umlauts
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184345@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65630&edit=1

 ID:                 65630
 Comment by:         strahil at gmail dot com
 Reported by:        marvin-wegener at outlook dot com
 Summary:            filter_var() return false with german umlauts
 Status:             Not a bug
 Type:               Bug
 Package:            Filter related
 Operating System:   Windows/Linux
 PHP Version:        5.5.3
 Block user comment: N
 Private report:     N

 New Comment:

Actually the problem persist with other filters as well. For example, this URL:

https://www.kfw.de/KfW-Konzern/Karriere/Jobs-Bewerbung/Jobbörse/Vertrieb/

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

So this indeed is a bug.


Previous Comments:
------------------------------------------------------------------------
[2013-09-09 04:40:08] pajoye@php.net

You have to use http://php.net/manual/en/function.idn-to-ascii.php

------------------------------------------------------------------------
[2013-09-08 21:42:03] 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] <http://www.php.net/manual/en/filter.filters.validate.php>
[2] <https://bugs.php.net/bug.php?id=65385>

------------------------------------------------------------------------
[2013-09-07 16:16:08] marvin-wegener at outlook dot com

Description:
------------
Hello,

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:
---------------
<?php
if(filter_var('example@öko.de', FILTER_VALIDATE_EMAIL))
{
	echo 'ok';
}
else
{
	echo 'fail';
}
?>



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65630&edit=1


Thread (6 messages)

« previous php.bugs (#184345) next »