php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49403 FILTER_VALIDATE_URL
Submitted: 2009-08-28 21:38 UTC Modified: 2009-08-30 15:16 UTC
From: botisdale at gmail dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.2.10 OS: win xp
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: botisdale at gmail dot com
New email:
PHP Version: OS:

 

 [2009-08-28 21:38 UTC] botisdale at gmail dot com
Description:
------------
It seems that the scheme is always required for FILTER_VALIDATE_URL, whether or not FILTER_FLAG_SCHEME_REQUIRED is used - making the second flag redundant.

Is this the expected behavior of FILTER_VALIDATE_URL?  Does it never evaluate 'example.com' to true?

---
From manual page: function.filter-var
---



Reproduce code:
---------------
---
From manual page: function.filter-var
---

#1:
<?php
var_dump(filter_var('example.com', FILTER_VALIDATE_URL));
?>

#2:
<?php
var_dump(filter_var('example.com', FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED));
?>

Expected result:
----------------
I'd expect to see:

#1: string(11) "example.com"

#2: bool(false)

Actual result:
--------------
#1: bool(false)

#2: bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-30 15:16 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 04:03:23 2021 UTC