Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110105 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55043 invoked from network); 10 May 2020 13:58:22 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 May 2020 13:58:22 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 20DDF1804F4 for ; Sun, 10 May 2020 05:34:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 10 May 2020 05:34:29 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id a9so5076318lfb.8 for ; Sun, 10 May 2020 05:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=duncanc-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pMJW6xE28ZzD0wo3Xw+FCjqxRbknJgzm4j+c4/yugaY=; b=fFz6BkBMUU3RUjlwQBHcFLbenShVtm/3eEpaRI2SJ9C2weOBrRyvBbu/cdXFHnoSlj RrCnLkEz0M3RKGVHIMicy2E4xKZBFo17vMIgzEHXycFLusEfvUJwPWCcnK+M/bGE7yqE AqtfhywJOzc36pPAxDk6SPpuVRTCjwRWQpj1ldWbrMIAWdeiZGHGHD1cInEEqZ7E+YTE gVCp36jQAGu26PbzY7pYSXPKl5etiQEyqvhvjdMCxDGsk+7jJdcMFRZHXUfyUfVhhUeg 8J1uKPNZbNTDQ8Cfp/Fbt6cNpKokOiuzb3b1XCO3xprpqQWcFpovPEjC9wzsv+xGHUuL Im1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pMJW6xE28ZzD0wo3Xw+FCjqxRbknJgzm4j+c4/yugaY=; b=hUPfqfPT+m3Wqxp91nmi/U44LUE65y8zV664IGB4FzpxmOqVgpni7ShAaY/nBZ7xwP drBlqRqp/c1DA54nEt+qTDoTZrZXRYX35JM+h7y0EIFGrlarv3dkqtSaw09z8OkhyaBM j+5eK7gXQnf7M8VYE+bcTY/jJ9pTOvXKpfBSANCGgDPV3iU1HvjA82QE22S24kHO0wFp I3c6lDNcxDyH7RoByM32fPWgEUwkJlhBt8Nx41pcur6tkxz3RjmPZ6TywKRGF6vTcwy6 EJkP/pB/xAOysKcfKS19m6iMPSgQFdHh0SDtNzJv+5sZPlYiEWQo5F4p/2Gs6o5djkmu 0cgw== X-Gm-Message-State: AOAM531iEgRf/GsJO9yJclPpNuXm5O/2X/VPgE4Rst+WoonikzZTPF50 WIDpBmuH0gGZA4C9fTA7LO91F9JeaR8= X-Google-Smtp-Source: ABdhPJznDRbG/U8zhbJ9YuPWRBueLS58h6QECbi9+HBDk2tgavIgj/1fo64+4UYMsUneeQJaTWRXPA== X-Received: by 2002:a19:10:: with SMTP id 16mr7705584lfa.145.1589114063512; Sun, 10 May 2020 05:34:23 -0700 (PDT) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id d5sm7021473lfn.56.2020.05.10.05.34.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 May 2020 05:34:22 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id z22so5098351lfd.0 for ; Sun, 10 May 2020 05:34:22 -0700 (PDT) X-Received: by 2002:ac2:4213:: with SMTP id y19mr7282634lfh.99.1589114062059; Sun, 10 May 2020 05:34:22 -0700 (PDT) MIME-Version: 1.0 References: <2157564.YClJE7JIHU@mcmic-probook> In-Reply-To: <2157564.YClJE7JIHU@mcmic-probook> Date: Sun, 10 May 2020 13:34:12 +0100 X-Gmail-Original-Message-ID: Message-ID: To: =?UTF-8?Q?C=C3=B4me_Chilliet?= Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000002d515905a54a7370" Subject: Re: [PHP-DEV] max_input_vars trigger detection From: php@duncanc.co.uk (Craig Duncan) --0000000000002d515905a54a7370 Content-Type: text/plain; charset="UTF-8" > > Although not particularly elegant, and it does require you to reject requests that hit but don't exceed the limit, I've used this approach before: $max = ini_get("max_input_vars") - 1; $check = count($_REQUEST); if ($check > $max) { throw new RequestException("Request is too large, only {$max} input variables are permitted"); } --0000000000002d515905a54a7370--