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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Wed Dec 04 18:01:31 2024 UTC