Bug #65141 [NEW]: filter_var() validates URL with two http:// as valid
| From: | demtheman at yahoo dot com | Date: | Thu, 27 Jun 2013 03:39:05 +0000 |
| Subject: | Bug #65141 [NEW]: filter_var() validates URL with two http:// as valid | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-179872@lists.php.net to get a copy of this message | ||
From: demtheman at yahoo dot com
Operating system: Windows 7 64-bit
PHP version: 5.3.26
Package: URL related
Bug Type: Bug
Bug description:filter_var() validates URL with two http:// as valid
Description:
------------
I used filter_var() to validate the URL http://http://www.google.com (as
test
URL), however it seems to see it as valid which in fact is wrong. Refer to
my SO
question
http://stackoverflow.com/questions/17333612/filter-var-accepts-invalid-
url
Test script:
---------------
$website = "http://http://www.google.com";
echo filter_var($website, FILTER_VALIDATE_URL);
Expected result:
----------------
The filter_var() should return FALSE.
Actual result:
--------------
The filter_var() returns the filtered data.
--
Edit bug report at https://bugs.php.net/bug.php?id=65141&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65141&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65141&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65141&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65141&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65141&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65141&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65141&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65141&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65141&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65141&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65141&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65141&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65141&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65141&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65141&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65141&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65141&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65141&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65141&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65141&r=mysqlcfg