filter-var

PHP filter_var() - FILTER_VALIDATE_URL

The FILTER_VALIDATE_URL filter seems to have some trouble validating non-ASCII URLs: var_dump(filter_var('http://pt.wikipedia.org/wiki/', FILTER_VALIDATE_URL)); // http://pt.wikipedia.org/wiki/ var_dump(filter_var('http://pt.wikipedia.org/wiki/Guimarães', FILTER_VALIDATE_URL)); // false Why isn't the last URL correctly validated? And ...

PHP FILTER_SANITIZE_URL swedish domain name

I am experimenting with filter_input and filter_var and I am currently trying to sanitize URLs with FILTER_SANITIZE_URL. The test program gets input from a GET variable which consists of a URL, (ex. foo.com/bar.php?a=http://www.domain.se). It works fine as long as I don't use swedish domain names. Ex: (foo.com/bar.php?a=http://www.äta.se...

Why FILTER_VALIDATE_URL return FALSE for only this url?

Hi, i have the following code: <?php $pictureurl="http://icons3.iconfinder.netdna-cdn.com/data/icons/pool/poolbird.png"; if(filter_var($pictureurl, FILTER_VALIDATE_URL) === FALSE){ echo "Invalid Url"; exit; }else{ echo "Works!"; } ?> This display "invalid url" (FALSE) for the above url, but not for other simpler urls. Is this a bug? y...

Intern working for Indian NGO - Help with PHP 4, advising staff

Hello, For the past three months I've been working for an Indian NGO (http://sevamandir.org), doing some volunteer work in the field but also trying to improve their website, which needs a ton of work. Recently I've been trying to fix the "subscribe to newsletter" button, which is broken. I used filter_var to filter the email input,...

PHP - BUG with filter_var and FILTER_VALIDATE_FLOAT

I think there is a bug in this filter_var or maybe I'm doing something wrong: Try this: $options = array( 'options' => array( 'default' => 3, 'min_range' => 1000.0, 'max_range' => 5000.6, ) ); $VariableValue2 = 5698; $VariableValue4 = 5698.2; ...