Florian Anderiasch wrote:
Gareth Ardron wrote:

Hi.

Think I've just stumbled upon a possible bug with is_int.

Hello Gareth,
if I'm not mistaken, $_REQUEST['days'] is a string, and unless you use

if (!is_int(intval($_REQUEST['days'])) || $_REQUEST['days'] < 0) {

I see no problem in is_int taking a string with numerals inside as not int.

the problem with this (which I did try before posting) is that of course is somebody enters a text string, and you run intval() on that, it'll return 1, not 0 as it has content. Only if it's empty would it return zero, and as such is_int() will return 1/true again.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to