php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69501 filter_var url validation does not support hebrew urls
Submitted: 2015-04-22 05:24 UTC Modified: 2015-04-22 12:10 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bitanetanel at gmail dot com Assigned:
Status: Open Package: Filter related
PHP Version: 5.5.24 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-04-22 05:24 UTC] bitanetanel at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.filter-var
---

filter_var url validation does not support hebrew urls
For example, this is a valid url: www.example.com/בדיקה
But the filter_var function returns false.

Test script:
---------------
<?php
$url = "http://www.example.com/אבג";
 
if(!filter_var($url, FILTER_VALIDATE_URL))
  {
  echo "Invalid URL";
  }
else
  {
  echo "Valid URL";
  }
?> 

will output "Invalid url", but it is a valid url..


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-22 12:10 UTC] cmb@php.net
-Type: Bug +Type: Feature/Change Request -Package: *General Issues +Package: Filter related
 [2015-04-22 12:10 UTC] cmb@php.net
That is documented behavior[1]. In short: FILTER_VALIDATE_URL
validates according to RFC 2396, which does not cater to IDNs.

I'm changing to feature request.

[1] <http://php.net/manual/en/filter.filters.validate.php>
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Mar 18 17:01:28 2019 UTC