|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-04-03 02:26 UTC] kalle@php.net
-Type: Security
+Type: Bug
[2016-04-03 02:30 UTC] kalle@php.net
-Status: Open
+Status: Not a bug
[2016-04-03 02:30 UTC] kalle@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 19:00:02 2025 UTC |
Description: ------------ The function FILTER_VALIDATE_URL is not validating the the Protocol of a URL.. Even if Its Compulsory to Pass Protocol to the function example: $url="fakeprotocol.fakedata.fakething.fakename.randomestring://www.google.com"; $r = filter_var($url, FILTER_VALIDATE_URL); the Above code Always Return True.. But is Should Be FALSE. coz of it's wrong protocol part & IT'S NOT A Valid Url Test script: --------------- <?php $url="fake.fake.fake.fake.fake.proto://www.google.com"; $r = filter_var($url, FILTER_VALIDATE_URL); if($r) { echo "Valid Url"; } else { echo "Invalid url"; } ?> Expected result: ---------------- if Protocol part of URL is in Invalid format It should not Return True.. coz url is Not Valid.. But the Above code is always Return "Valid url" as Output