Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20844 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3638 invoked by uid 1010); 29 Nov 2005 17:19:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3623 invoked from network); 29 Nov 2005 17:19:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2005 17:19:16 -0000 X-Host-Fingerprint: 81.103.221.49 mta09-winn.ispmail.ntl.com Solaris 8 (1) Received: from ([81.103.221.49:61533] helo=mta09-winn.ispmail.ntl.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 58/B9-14828-49D8C834 for ; Tue, 29 Nov 2005 12:19:16 -0500 Received: from aamta10-winn.ispmail.ntl.com ([81.103.221.35]) by mta09-winn.ispmail.ntl.com with ESMTP id <20051129171912.IMBL8609.mta09-winn.ispmail.ntl.com@aamta10-winn.ispmail.ntl.com>; Tue, 29 Nov 2005 17:19:12 +0000 Received: from [192.168.0.21] (really [81.106.214.135]) by aamta10-winn.ispmail.ntl.com with ESMTP id <20051129171912.WJJG11396.aamta10-winn.ispmail.ntl.com@[192.168.0.21]>; Tue, 29 Nov 2005 17:19:12 +0000 Message-ID: <438C8DE5.8080905@fission.org.uk> Date: Tue, 29 Nov 2005 17:20:37 +0000 User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Florian Anderiasch CC: internals@lists.php.net References: <438C7A4C.9090503@fission.org.uk> <438C83C6.10405@anderiasch.de> In-Reply-To: <438C83C6.10405@anderiasch.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] is_int/is_numeric possible bug From: gareth@fission.org.uk (Gareth Ardron) 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.