fingers Posted November 17, 2014 Share Posted November 17, 2014 Hi Larry Whilst debugging an error in script 9.9 - page.php I inadvertantly discovered that array('min_range' =>1) doesn't seem to do anything in this line: !filter_var($_GET['id'], FILTER_VALIDATE_INT, array('min_range' => 1))) After fixing my problem I played around with this, changing it to == 2, < 0, => 5 etc. and omitting it altogether, yet the script still worked. Have I missed something? Thanks Gary Link to comment Share on other sites More sharing options...
Larry Posted November 21, 2014 Share Posted November 21, 2014 Hmmmm...may be a bug there. Thanks for bringing this to my attention. I'll investigate! Link to comment Share on other sites More sharing options...
Larry Posted February 8, 2016 Share Posted February 8, 2016 (Finally clearing up threads that I've been "watching" for wwwwwaaaaaaayyyyy too long, but for posterity...) This may have been a change in PHP since the book was written as the PHP manual now says you should pass options as an options array: http://php.net/manual/en/function.filter-var.php In other words, the code should be: !filter_var($_GET['id'], FILTER_VALIDATE_INT, array('options' => array('min_range' => 1)))) Link to comment Share on other sites More sharing options...
Recommended Posts