Doc #64173 [NEW]: filter_var filter_validate_url incorrect

From: Date: Fri, 08 Feb 2013 09:03:52 +0000
Subject: Doc #64173 [NEW]: filter_var filter_validate_url incorrect
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9510@lists.php.net to get a copy of this message
From: retze dot faber at gmail dot com Operating system: debian squeeze PHP version: Irrelevant Package: Filter related Bug Type: Documentation Problem Bug description:filter_var filter_validate_url incorrect Description: ------------ --- From manual page: http://www.php.net/function.filter-var --- http://http://www.google.com passes filter_var with FILTER_VALIDATE_URL Test script: --------------- $url = $_REQUEST['url']; if (filter_var("http://" . $url, FILTER_VALIDATE_URL)) $filter="true"; else $filter="false"; echo "Filter var result of concat with http is:" . $filter . "<br>"; Expected result: ---------------- I expect it to return false when i run the script with http://www.google.com and true when i run it with www.google.com Actual result: -------------- It returns true in both cases -- Edit bug report at https://bugs.php.net/bug.php?id=64173&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64173&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64173&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64173&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64173&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64173&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64173&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64173&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64173&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64173&r=support Expected behavior: https://bugs.php.net/fix.php?id=64173&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64173&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64173&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64173&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64173&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64173&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64173&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64173&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64173&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64173&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64173&r=mysqlcfg

« previous php.doc.bugs (#9510) next »