Doc #64173 [Opn->Fbk]: filter_var filter_validate_url incorrect

From: Date: Sat, 02 Mar 2013 14:30:45 +0000
Subject: Doc #64173 [Opn->Fbk]: filter_var filter_validate_url incorrect
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9609@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64173&edit=1 ID: 64173 Updated by: salathe@php.net Reported by: retze dot faber at gmail dot com Summary: filter_var filter_validate_url incorrect -Status: Open +Status: Feedback Type: Documentation Problem Package: Filter related Operating System: debian squeeze PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I don't see this as a documentation bug. This filter effectively just calls parse_url() on the value and looks to see if the resulting array makes some sense. Running "http://http://www.google.com" through parse_url() gives an array like array('scheme' => 'http', 'host' => 'http', 'path' => '//www.google.com'). If you feel this is a bug in the filter, please change the Bug Type to "bug". If you feel this is not a bug in the implementation, rather still a documentation problem then could you elaborate on what details you would like to be added or changed? A final option is to close off this report if you decide that this behaviour is now to be expected and there is no issue. Let us know what you think. Previous Comments: ------------------------------------------------------------------------ [2013-02-08 09:03:52] retze dot faber at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=64173&edit=1

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