Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50053 invoked by uid 1010); 29 Nov 2005 15:57:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 50038 invoked from network); 29 Nov 2005 15:57:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2005 15:57:18 -0000 X-Host-Fingerprint: 81.103.221.49 mta09-winn.ispmail.ntl.com Solaris 8 (1) Received: from ([81.103.221.49:13706] helo=mta09-winn.ispmail.ntl.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id C4/82-14828-D5A7C834 for ; Tue, 29 Nov 2005 10:57:18 -0500 Received: from aamta09-winn.ispmail.ntl.com ([81.103.221.35]) by mta09-winn.ispmail.ntl.com with ESMTP id <20051129155712.EKAI8609.mta09-winn.ispmail.ntl.com@aamta09-winn.ispmail.ntl.com> for ; Tue, 29 Nov 2005 15:57:12 +0000 Received: from [192.168.0.20] (really [81.106.214.135]) by aamta09-winn.ispmail.ntl.com with ESMTP id <20051129155712.PIFY1233.aamta09-winn.ispmail.ntl.com@[192.168.0.20]> for ; Tue, 29 Nov 2005 15:57:12 +0000 Message-ID: <438C7A4C.9090503@fission.org.uk> Date: Tue, 29 Nov 2005 15:57:00 +0000 User-Agent: Debian Thunderbird 1.0.7 (X11/20051002) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: is_int/is_numeric possible bug From: gareth@fission.org.uk (Gareth Ardron) Hi. Think I've just stumbled upon a possible bug with is_int. if you've got the following code:
days::".$_REQUEST['days']; ?> and somebody enters, say "jkhdsjh" into the form, is_int() returns 1, thereby not setting the $_REQUEST['days'] variable to 10 - if I switch to using is_numeric then everything works as it should. Obviously, this isn't ideal as somebody could then enter 2.5 rather than the integers that I want to be passed. Looking at the source, this is in ext/standard/type.c in the php_is_type() function which seems to be messing up. Can anybody confirm this is: a) undesired behaviour and I'm not just being very "special" and b) that this is happening. I've tried on two boxes with 5.1.1[0] but it'd help to get somebody else's opinion If it's a bug, I'll do a patch up later tonight - just want to get it confirmed first. Cheers. -- Gareth Ardron [0] both debian/linux boxes. One i386, one x86_64.