Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53785 invoked from network); 8 Feb 2013 20:19:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2013 20:19:59 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.21 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.21 smtp1.ist.utl.pt Linux 2.6 Received: from [193.136.128.21] ([193.136.128.21:37022] helo=smtp1.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/73-18015-CED55115 for ; Fri, 08 Feb 2013 15:19:57 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id 6E7BD70003C0; Fri, 8 Feb 2013 20:19:53 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp1.ist.utl.pt ([127.0.0.1]) by localhost (smtp1.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id IT65fl0q+gxO; Fri, 8 Feb 2013 20:19:53 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp1.ist.utl.pt (Postfix) with ESMTP id 269927000440; Fri, 8 Feb 2013 20:19:51 +0000 (WET) Received: from damnation.nl.lo.geleia.net (unknown [IPv6:2001:470:94a2:4:21d:baff:feee:cc0b]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 6929F2002E32; Fri, 8 Feb 2013 20:19:49 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "'Patrick Schaaf'" , "internals@lists.php.net" , "Frank Liepert" , hakre Cc: "'Derick Rethans'" , "'Martin Jansen'" References: <510EA95F.40503@divbyzero.net> <2835262.zO39iNXCyM@rofl> <002d01ce02c8$dbb6d430$93247c90$@Liepert@gmx.de> <1360350275.70839.YahooMailNeo@web133005.mail.ir2.yahoo.com> Date: Fri, 08 Feb 2013 21:19:46 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: <1360350275.70839.YahooMailNeo@web133005.mail.ir2.yahoo.com> User-Agent: Opera Mail/12.12 (Linux) Subject: Re: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0 From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Fri, 08 Feb 2013 20:04:35 +0100, hakre wrote: > ----- Urspr=C3=BCngliche Message ----- >> Von: Gustavo Lopes >> >> So the question is only whether "+0" or "-0" (or >> "+0", etc.) should be accepted as integers by FILTER_VALIDATE_INT. I >> think they should, because we also accept non-canonical inputs such a= s >> "+5", i.e., we always accept a sign. It's true that 0 is neither >> positive or negative, but I don't think "accepts a leading sign, exce= pt >> if it's 0" is a good option. It's an unnecessary special case. > > A special case still left is "=C2=B10". It is with the 'PLUS-MINUS SIG= N' = > (U+00B1). By special case, I meant a deviation to the general rule on how the code= = handles the input. The code handles the characters 0-9 prefixed by an = optional sign. The PLUS-MINUS SIGN -- or, for that matter, all the other= = numeric characters in the Unicode repertoire -- are irrelevant. > It's an equally incorrect sign for the number 0 as "-" or "+" is = > incorrect. Available in internet standards ISO-8859-1 and more as = > "\xB1" (UTF-8 as "\xC2\xB1"), FILTER_VALIDATE_INT should reflect hidd= en = > dependency of input encoding here. I'm not sure what you're arguing for here. -- = Gustavo Lopes