Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95762 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19151 invoked from network); 7 Sep 2016 18:00:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2016 18:00:53 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:35343] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/63-06456-4D550D75 for ; Wed, 07 Sep 2016 14:00:52 -0400 Received: by mail-wm0-f41.google.com with SMTP id i204so99248723wma.0 for ; Wed, 07 Sep 2016 11:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=+3JGddMJn0lEFhJlRI3UT3E+s2CQ12o6ESelOdY4Q6Y=; b=G08Rxz2lyml5P/tjoQCatufkuBfGIR7YvAYLkIGtqDkC1C26Nwi2TWUjmR2PYm9voy pSnB4D6UFgZbTtzA8Yz/AhYjVdRK1CUQ3mbO/C5oHXWDMhJrDV/vjGdHkcSObkkVtdpi /NLCSN+mxdxjqplyU6Z/NTBEg+LcvT13KVRMqcQccCVzGE+uJ327XXbouRLHtXPOBdQr al5W1/JTMxmd7xFtAqzOcIJJbjf7LF9onECoZ/Fk2X4JoL67jElkwNki3q7jPihDrWkf tACv2c/iAZomFrYqZw4opQVjnV6WWQ67k1R4F6FX5yPAsUGoTc+3gw3U/7cercBr6AX8 2kVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=+3JGddMJn0lEFhJlRI3UT3E+s2CQ12o6ESelOdY4Q6Y=; b=B/pp9bj8bmMiAbus7LtCWtH3c9OGEFz7n3y7znO39gMc5M1Vr+Mp9ywE3Lb8DjnIOZ amnOzzi4a93+AX8P1BV7a6EUahtwAenIYVszQv/9rSlCqOPsaij9IDLygDm0+E67wdB9 lKnhx9YsJwgz5DN5QpcNXQfXDi7+54VMiq20N+Se5iTmprTTKKeEo2c2xzdEu457ttOL a+eAE2X9KElowWeZtJKVy6rDVWToytYgPnWrdqPVdX1L0eE70D45FTklBK2AXaQiQoUP MSvC2hvGSe4TGVeFH33DXlC2RO5ZIOdJ/nE+OWLY8qGg6KShvFsCr8YkB6f3FM/KVOgu wNXw== X-Gm-Message-State: AE9vXwMxX3QKPwqnjCZIZ7cLgp1BOShlG8Ya6xAkPXssGriujD0CSFplrWdMESupesZv0Q== X-Received: by 10.28.140.5 with SMTP id o5mr5364781wmd.13.1473271248622; Wed, 07 Sep 2016 11:00:48 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id r4sm5392598wme.21.2016.09.07.11.00.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Sep 2016 11:00:47 -0700 (PDT) References: <232F1604-2211-4351-B830-EDC958A25D6D@strojny.net> <2de35db0-9974-cc96-83dd-3d2dbd48f7f8@lsces.co.uk> <5b72e9da-068a-bc79-82c2-f36f723f42bb@gmail.com> To: "internals@lists.php.net" Message-ID: Date: Wed, 7 Sep 2016 18:58:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][VOTE] Add validation functions to filter module From: rowan.collins@gmail.com (Rowan Collins) On 06/09/2016 02:56, Yasuo Ohgaki wrote: > Hi Rowan, > > On Fri, Sep 2, 2016 at 7:37 PM, Rowan Collins wrote: >> This certainly makes sense. I guess the challenge is that in order to know >> if data has been tampered, you need to have some knowledge of the expected >> format. That expectation depends on what data you're expecting, which >> depends - ultimately - on the domain objects being modelled. >> >> More specifically, though, it depends on the interaction design - in an HTML >> context, the forms being presented. So the validation needs knowledge of the >> form controls - e.g. if a select box was shown, and the value is not from >> the known list of options, the input has been tampered with. > BTW, I don't think everyone has to validate input very strict > manner. It is ok to validate like > > // Define loose input validation > > > $get_def = array( > // GET > 'id' => $id_spec, > 'other_id' => $id_spec, > 'type1' => $alnum32b_spec, // Alpha numeric up to 32 bytes > 'type2'=> $alnum32b_spec, > ); > > $post_def = array( > // POST > 'text1' => $input_tag_spec, // default up to > // 512 bytes text > 'text2' => $input_tag_spec, > 'select1' => $select_tag_spec, //