note 129660 added to function.filter-var
| From: | axew3@me.you | Date: | Fri, 19 Jul 2024 17:04:29 +0000 |
| Subject: | note 129660 added to function.filter-var | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221431@lists.php.net to get a copy of this message | ||
I've see some report about FILTER_VALIDATE_URL and i also would like to add mine, because into
a stupid code like this:
<?php
$ckOrigin = 'https://forum.myw3host.comhttps://forum.myw3host.comhttps://forum.myw3host.com/viewtopic.php?p=45#p45';
if(filter_var($ckOrigin, FILTER_VALIDATE_URL)){
echo 'ok the URL is valid';
}
?>
since i was sure that in case the url were wrong it had returned false, I spent a lot of time to
realize that it instead fail into a string like the one above, and it return true.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 2.37.165.204)
----
Manual Page -- https://php.net/manual/en/function.filter-var.php
Edit -- https://main.php.net/note/edit/129660
Del: integrated -- https://main.php.net/note/delete/129660/integrated
Del: useless -- https://main.php.net/note/delete/129660/useless
Del: bad code -- https://main.php.net/note/delete/129660/bad+code
Del: spam -- https://main.php.net/note/delete/129660/spam
Del: non-english -- https://main.php.net/note/delete/129660/non-english
Del: in docs -- https://main.php.net/note/delete/129660/in+docs
Del: other reasons-- https://main.php.net/note/delete/129660
Reject -- https://main.php.net/note/reject/129660
Search -- https://main.php.net/manage/user-notes.php