Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95247 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27045 invoked from network); 17 Aug 2016 00:02:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2016 00:02:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:34069] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/81-18246-D99A3B75 for ; Tue, 16 Aug 2016 20:02:39 -0400 Received: (qmail 9234 invoked by uid 89); 17 Aug 2016 00:02:33 -0000 Received: from unknown (HELO mail-qk0-f175.google.com) (yohgaki@ohgaki.net@209.85.220.175) by 0 with ESMTPA; 17 Aug 2016 00:02:33 -0000 Received: by mail-qk0-f175.google.com with SMTP id l2so87133572qkf.3 for ; Tue, 16 Aug 2016 17:02:33 -0700 (PDT) X-Gm-Message-State: AEkoouuq1UMkkLLFQ7YhMjaS7bGr1a1JQOuSSHtpeNF004Htlvt6ccf1Dqi0KdW3gEXboxolbXVOVGdKwTHvdQ== X-Received: by 10.233.232.195 with SMTP id a186mr40087000qkg.18.1471392147467; Tue, 16 Aug 2016 17:02:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.85.242 with HTTP; Tue, 16 Aug 2016 17:01:46 -0700 (PDT) In-Reply-To: <90.51.36656.0C0A1B75@pb1.pair.com> References: <90.51.36656.0C0A1B75@pb1.pair.com> Date: Wed, 17 Aug 2016 09:01:46 +0900 X-Gmail-Original-Message-ID: Message-ID: To: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: [RFC][VOTE] Add validation functions to filter module From: yohgaki@ohgaki.net (Yasuo Ohgaki) To those who voted "no" for this, On Mon, Aug 15, 2016 at 8:00 PM, Tony Marston wrote: > "Dan Ackroyd" wrote in message > news:CA+kxMuRiOBQpmTeKqNyV8rX0GKCLrYixi--y5TcYUkdqpT746w@mail.gmail.com... >> >> >> Hi Yasuo, >> >> On 15 August 2016 at 01:53, Yasuo Ohgaki wrote: >> >>> One more usual request. >>> Please describe reason(s) why you object proposal. >> >> >> >> I'm not entirely sure why you ask for reasons when people vote no. The >> reasons are almost always the same as the reasons given before the >> voting starts. >> >> But for posterity: >> >> i) Validation error messages need to specify what is wrong.....which >> is bespoke to the application. Which is a reason why validation code >> belongs in userland. > > > I agree 100% > >> ii) Validation error message need to be in the correct language for an >> application. It is not a good approach for people to be trying to >> match strings emitted by internal code and trying to convert them to >> the correct language. > > > I agree 100% > >> iii) The argument that it needs to be fast could be applied to >> anything and everything, and so is bogus. The RFC doesn't even show >> that userland implementations are slow enought to be a concern. >> >> iv) The RFC makes an assumption that programs should exit when validation >> fails. >> >> "Input data validation should accept only valid and possible inputs. >> If not, reject it and terminate program." > > > I DISagree 100%. Validation errors should NEVER terminate the program, they > should continue by displaying all the error messages to the user so that > he/she can correct his/her mistake and try the operation again. > >> and the code example: >> >>> catch (FilterValidateException $e) { >>> var_dump($e->getMessage()); >>> die('Invalid input detected!'); // Should terminate execution when >>> input validation fails >>> } >> >> >> This assumption is bogus. >> >> Any program that accepts data from users should provide useful error >> messages when the data is wrong with someting as simple as a string >> being too long. > > > I agree 100% > >> v) I don't like the current filter functions, and recommend people >> avoid using them. Adding to them with an even harder to use API is the >> wrong way to go. > > > I agree 100% > > > -- > Tony Marston Could you explain why or express "same opinion here"? IMHO, this opinion is based on misunderstanding of secure coding and software security methodology. However, either way is helpful. There are many that seem "the input validation should be implemented by userland fully". If this is true, I'm going to propose "Filter module" deprecation next. It's better not to have misleading and/or half implemented module for security purpose. Thank you! -- Yasuo Ohgaki yohgaki@ohgaki.net