note 100708 added to function.filter-var
| From: | Remon at osu1 dot php dot net | Date: | Mon, 01 Nov 2010 15:25:20 +0000 |
| Subject: | note 100708 added to function.filter-var | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173661@lists.php.net to get a copy of this message | ||
Please note that filter flag FILTER_FLAG_SCHEME_REQUIRED from Example #1 is false!
The flag is not defined on and cannot be used.
Both examples below return false:
<?php
var_dump(filter_var('example.com', FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED));
var_dump(filter_var('example.com', FILTER_VALIDATE_URL));
?>
The source of filters shows that:
- It always returns false when the scheme is NULL.
- FILTER_FLAG_SCHEME_REQUIRED is not used there.
So be aware that example.com will never be validated.
----
Server IP: 85.214.154.209
Probable Submitter: 84.63.181.244
----
Manual Page -- http://www.php.net/manual/en/function.filter-var.php
Edit -- https://master.php.net/note/edit/100708
Del: integrated -- https://master.php.net/note/delete/100708/integrated
Del: useless -- https://master.php.net/note/delete/100708/useless
Del: bad code -- https://master.php.net/note/delete/100708/bad+code
Del: spam -- https://master.php.net/note/delete/100708/spam
Del: non-english -- https://master.php.net/note/delete/100708/non-english
Del: in docs -- https://master.php.net/note/delete/100708/in+docs
Del: other reasons-- https://master.php.net/note/delete/100708
Reject -- https://master.php.net/note/reject/100708
Search -- https://master.php.net/manage/user-notes.php