note 117425 added to filter.filters.validate

From: Date: Tue, 09 Jun 2015 15:33:56 +0000
Subject: note 117425 added to filter.filters.validate
Groups: php.notes 
Request: Send a blank email to php-notes+get-202785@lists.php.net to get a copy of this message
When validating a URL, as documented, the protocol is not validated. However, it is required to be present. For example: I don't expect a protocol to be present. To validate expected input I have to add a "protocol" as a prefix, and return true or false, and further validate the input. $r = filter_var(''this.doesnt.matter.so.why.is.it.required://'.$host, FILTER_VALIDATE_URL); return ($r != '' && $r !== false) ? true : false; ---- Server IP: 72.52.91.14 Probable Submitter: 199.188.172.130 ---- Manual Page -- http://php.net/manual/en/filter.filters.validate.php Edit -- https://master.php.net/note/edit/117425 Del: integrated -- https://master.php.net/note/delete/117425/integrated Del: useless -- https://master.php.net/note/delete/117425/useless Del: bad code -- https://master.php.net/note/delete/117425/bad+code Del: spam -- https://master.php.net/note/delete/117425/spam Del: non-english -- https://master.php.net/note/delete/117425/non-english Del: in docs -- https://master.php.net/note/delete/117425/in+docs Del: other reasons-- https://master.php.net/note/delete/117425 Reject -- https://master.php.net/note/reject/117425 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#202785) next »