Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65733 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59934 invoked from network); 8 Feb 2013 21:09:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2013 21:09:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=hanskrentel@yahoo.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=hanskrentel@yahoo.de; sender-id=unknown; domainkeys=good Received-SPF: error (pb1.pair.com: domain yahoo.de from 212.82.109.234 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hanskrentel@yahoo.de X-Host-Fingerprint: 212.82.109.234 nm23-vm5.bullet.mail.ird.yahoo.com Received: from [212.82.109.234] ([212.82.109.234:22383] helo=nm23-vm5.bullet.mail.ird.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/94-18015-68965115 for ; Fri, 08 Feb 2013 16:09:27 -0500 Received: from [77.238.189.231] by nm23.bullet.mail.ird.yahoo.com with NNFMP; 08 Feb 2013 21:09:23 -0000 Received: from [212.82.108.135] by tm12.bullet.mail.ird.yahoo.com with NNFMP; 08 Feb 2013 21:09:23 -0000 Received: from [127.0.0.1] by omp1040.mail.ird.yahoo.com with NNFMP; 08 Feb 2013 21:09:23 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 684379.76450.bm@omp1040.mail.ird.yahoo.com Received: (qmail 54781 invoked by uid 60001); 8 Feb 2013 21:09:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1360357763; bh=YIHDNFmBhmIB34rVC4H4/Z9dq8Wrcb63fkC/vafQ5SE=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=AsUe4m+P4jmcSTS/ZDLZd5P6FvenZanZpJRF16BclDjxiUmblHaDhWscnDmxr98yj9XR0zZ2CFnE0DNihrF2ws3e5TSRWBJaedVIb0+EcM1RJ7Diox3LtfBrgHWagL6ODwedfvIgwzloP/5A03+oM2DFNBUIcUQlnOMBapqmujU= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=QHq1DXNXclGopoHY1UyqTUvcUkEoUzfnRycTXkPmbX5qJBzDasLJ0B/HXgT400J7lZe+LhABB9s1eL8vWhIibK9fPuUciqKBaFIQZtnQfoPbN/8ZzmxAydr1Dds8sTJ2/5/OqW9Shx5/IKsRIPmSmtS5oyYMO9xcuj9fUoPQMHA=; X-YMail-OSG: uBPOj6YVM1m3EYKbO2MOFDj9oCL.4cFbtB0RmWnDp5r80X7 zx1E5oLuAXoMTtz_YdPF8i1VnojoBu0e1toRgSFQEXdtuxOZfF_65cGjmLSB LyGkHBMuCArG38uJsESlfRehgK0tRRTR3iKYUj3nlK35RDMWqxEBKNStd2oN Xx4P9Y6FRAnC0UCmAI5BNwD2_AcjCL_aSLHKNjJWARJ5BFLrStqUFjCEXn3y IR5DPtkzywvBNlOnHK2FhUaN3X2FNM1xLO3h6Fn5GEOiWXIICH6uLPfIg._z bkAiu6qOfX.Wi7wqEIsW1tVa.1Ls5re90XG_nc_bgdoYtFQAwckHVmXHvZH1 .wmJKgClDjfkbqrVaEBJiZ.5HIfyXiXFUl1UHOfJLSjGVY6obh2E.OONnUqw CL2QIgFHK25X2T_H_MAtOjp03doDnzWGb.8YQ8Qk_uMP9tXD3IZPNmrAl8kr QUIBabJg1Ht1wOkROWX_mcKlgYpoTgVTtbQ4eKNU6vIch5JCb2UQ- Received: from [79.225.56.24] by web133003.mail.ir2.yahoo.com via HTTP; Fri, 08 Feb 2013 21:09:22 GMT X-Rocket-MIMEInfo: 001.001,CgoKLS0tLS0gVXJzcHLDvG5nbGljaGUgTWVzc2FnZSAtLS0tLQo.IFZvbjogR3VzdGF2byBMb3BlcyA8Z2xvcGVzQG5lYm0uaXN0LnV0bC5wdD4KPiBBbjogJ1BhdHJpY2sgU2NoYWFmJyA8cGhwQGJvZi5kZT47ICJpbnRlcm5hbHNAbGlzdHMucGhwLm5ldCIgPGludGVybmFsc0BsaXN0cy5waHAubmV0PjsgRnJhbmsgTGllcGVydCA8RnJhbmsuTGllcGVydEBnbXguZGU.OyBoYWtyZSA8aGFuc2tyZW50ZWxAeWFob28uZGU.Cj4gQ0M6ICdEZXJpY2sgUmV0aGFucycgPGRlcmlja0BwaHAubmV0PjsgJ01hcnRpbiABMAEBAQE- X-Mailer: YahooMailWebService/0.8.132.503 References: <510EA95F.40503@divbyzero.net> <2835262.zO39iNXCyM@rofl> <002d01ce02c8$dbb6d430$93247c90$@Liepert@gmx.de> <1360350275.70839.YahooMailNeo@web133005.mail.ir2.yahoo.com> Message-ID: <1360357762.54581.YahooMailNeo@web133003.mail.ir2.yahoo.com> Date: Fri, 8 Feb 2013 21:09:22 +0000 (GMT) Reply-To: hakre To: Gustavo Lopes , 'Patrick Schaaf' , "internals@lists.php.net" , Frank Liepert Cc: 'Derick Rethans' , 'Martin Jansen' In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0 From: hanskrentel@yahoo.de (hakre) =0A=0A=0A----- Urspr=FCngliche Message -----=0A> Von: Gustavo Lopes =0A> An: 'Patrick Schaaf' ; "internals@lists.p= hp.net" ; Frank Liepert ; ha= kre =0A> CC: 'Derick Rethans' ; 'Mart= in Jansen' =0A> Gesendet: 21:19 Freitag, 8.Februar 20= 13=0A> Betreff: Re: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0=0A> =0A=0A>= >=A0=A0A special case still left is "=B10". It is with the 'PLUS-MINUS =0A>= SIGN' (U+00B1).=0A> =0A> By special case, I meant a deviation to the gener= al rule on how the code handles =0A> the input. The code handles the charac= ters 0-9 prefixed by an optional sign.=0A=0AThe general rule is to either a= llow + 'PLUS SIGN' (U+002B) and - 'HYPHEN-MINUS' (U+002D) for all positive= natural numbers excluding zero.=0A=0AThe discussion is about to allow thos= e as well for zero.=0A=0AThe 'PLUS-MINUS SIGN' (U+00B1) is a relevant sign = for the number zero in this context but it got unnoticed so far in the disc= ussion.=0A=0ATo not deviate from the general rule to allow signs in front o= f all positive natural numbers excluding zero for the missing zero, all val= id plus and minus signs including *both at once* as possible for zero shoul= d be properly filtered as valid integers.=0A=0AIf you aim to have UTF-8 com= patibility with the input, you should also consider 'MINUS SIGN' (U+2212), = I didn't mention it so far because PHP by default targets ISO-8859-1 (at le= ast commonly, historically and by popularity), so I only covered the sign i= n Latin-1.=0A=0A> The =0A> PLUS-MINUS SIGN -- or, for that matter, all the= other numeric characters in the =0A> Unicode repertoire -- are irrelevant.= =0A=0AUnicode is never irrelevant, it's used to communicate clearly and spe= cifically about which signs I'm concerned about.=0A=0AUnicode does not clas= sify "numeric characters", you probably meant 'Number, Decimal Digit', 'Sym= bol, Math [Sm]', 'Punctuation, Dash' or 'Number, Other' but it remains unsp= ecified in your email. Would you please elaborate?=0A=0A> =0A>>=A0=A0It's a= n equally incorrect sign for the number 0 as "-" or =0A> "+" is incorrect. = Available in internet standards ISO-8859-1 and more =0A> as "\xB1"=A0 (UTF-= 8 as "\xC2\xB1"), =0A> FILTER_VALIDATE_INT should reflect hidden dependency= of input encoding here.=0A> =0A> I'm not sure what you're arguing for here= .=0ATo make the feature complete, the input encoding needs to be hinted for= those signs otherwise the FILTER_VALIDATE_INT won't work properly with str= ings with an unexpected encoding (UTF-8 since PHP 5.4 (?!); ISO-8859-1 in t= he past).=0A=0AOtherwise I'd say it's important to document a note that the= function is US-ASCII / ISO-8859-1 safe (only?) as this is string input val= idation.=0A=0A-- hakre