Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95246 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24735 invoked from network); 16 Aug 2016 23:44:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2016 23:44:07 -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:34037] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/11-18246-445A3B75 for ; Tue, 16 Aug 2016 19:44:07 -0400 Received: (qmail 8289 invoked by uid 89); 16 Aug 2016 23:44:01 -0000 Received: from unknown (HELO mail-qt0-f171.google.com) (yohgaki@ohgaki.net@209.85.216.171) by 0 with ESMTPA; 16 Aug 2016 23:44:01 -0000 Received: by mail-qt0-f171.google.com with SMTP id x25so42764549qtx.2 for ; Tue, 16 Aug 2016 16:44:00 -0700 (PDT) X-Gm-Message-State: AEkooutWkU9GAdcw3An9vqHVmyhiYbSHrNnjELI7Bcs64rt8hQjGtfD6IfEJLSGPQi/QbcuHtE/CKyWRR6+Xdg== X-Received: by 10.237.53.206 with SMTP id d14mr42901031qte.83.1471391033865; Tue, 16 Aug 2016 16:43:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.85.242 with HTTP; Tue, 16 Aug 2016 16:43:13 -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 08:43:13 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Tony Marston Cc: "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) Hi Tony, Allow me to top post. "The input validation" is not for legitimate users, but for attackers. You shouldn't help attackers by explaining what/how wrong in attackers' inputs. I've added discussion "Input validation and User input mistake handling difference" https://wiki.php.net/rfc/add_validate_functions_to_filter#input_validation_and_user_input_mistake_handling_difference Please refer to the section for distinction. BTW, the input validation that I'm proposing here is required/recommended feature by ISO 27000/ISMS. Why shouldn't PHP provide features that is needed to implement ISO 27000/ISMS requirements? 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% -- Yasuo Ohgaki yohgaki@ohgaki.net