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
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: bitanetanel at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC