Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107355 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21235 invoked from network); 1 Oct 2019 14:42:04 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 1 Oct 2019 14:42:04 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id E5BED2D19AB for ; Tue, 1 Oct 2019 05:22:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.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,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Tue, 1 Oct 2019 05:22:41 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id v2so47228668iob.10 for ; Tue, 01 Oct 2019 05:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lerdorf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8/RQS52fDjqoB23I4ZU4GtDvspAnV3hLQ05/Og/nyx0=; b=bg9NGZqonqa+8XgahlpcZbBs0zrRifqCHNTSf9Ip6PyeGhRhfAOCU09vyb8SEk/d5z s5FKHFE9HyIBt7FOaw58x/D+CvZy2BiWHnEvSFkclawXap1eUy9+B9D9Amp7Yzwrf3GY QC13+41xgRspBjTmBmpBeMKtDmfxTe08pC3k3uhPjV69KXB8Z7EhMI7weQOAe/zWVMvs htE98At5Al4ffUIJcRPzCFyQ5ph0oDVGwsbkSSb9qgR6OnBoZdyxUuKyczzvmfHZ+pX+ KeXWWuDqM5YzZ6QIjRjOhes73ZOQYI6PdRbJQ2dO8iiMHrEKbrUbnFhep0kmC9oCaOpX VO0w== 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=8/RQS52fDjqoB23I4ZU4GtDvspAnV3hLQ05/Og/nyx0=; b=TJ6u+R6w0ImzNdfBDmzCQZK7yTYweelMYYPu/mA8JNrdQTXbY5l+uQ1xSwbOJYk0RM YDOPBtPU/ygpeRufeIojj9l9jdL+vEjcDwHId5CZSKUM9FLPtq0HERMUsglwCA2I/sJB VcUUxCYF582QkvAhBR8gt+eYs6hWsCyenM+HFteLwtFygEEksyklV8z0Zmg8heIwuWru ZMp/i9hIEJAdWjPC8uDLPJlkEBIO35eqOA73u7gKN2QPXCCy8Z7cxwvQsgix6rGN9Tfv sa8UoUjKto/iqKk1jbiZ+kJpdrWPu94B3YioQqA/wKaKFqsfSPtDhQhvccvfSxNWK53I RXTA== X-Gm-Message-State: APjAAAXgqioCJG3v86hdzLk5RPkpD4r2eaIZxCHuctZGM6W50M1rxkmE 7ZtC1bjlWtQFPDQrWakcGXb6VKoZIa8G3FEF/3H2DA== X-Google-Smtp-Source: APXvYqwQOkZ14ZaBuiOquVYpOTKxr4PoFdzzznO9GbDjkzUQMDvQCSfhVv8E9sAxvHrRRLPxQGiu/vrkwFJ3UgCc45U= X-Received: by 2002:a5e:990f:: with SMTP id t15mr4270622ioj.270.1569932560249; Tue, 01 Oct 2019 05:22:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 1 Oct 2019 05:22:04 -0700 Message-ID: To: Benjamin Morel Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000009358550593d8683e" X-Envelope-From: Subject: Re: [PHP-DEV] Error when POST / upload limits are exceeded From: rasmus@lerdorf.com (Rasmus Lerdorf) --0000000000009358550593d8683e Content-Type: text/plain; charset="UTF-8" On Tue, Oct 1, 2019 at 1:00 AM Benjamin Morel wrote: > Hi internals, > > One thing that always bugged me is how PHP silently ignores data that > exceeds the limits defined in php.ini. > > For example, posting a form exceeding post_max_size results in empty $_POST > and $_FILES, with no error message whatsoever. This has bugged a few more > people than just myself, if I believe this StackOverflow question > with 37k views. > > Another example is max_file_uploads: if I upload more files that the > configured value, the subsequent files are silently ignored, and only the > first n files appear in $_FILES. > > I'd like to work on an RFC to make all these errors in PHP 8 (ideally with > a way to catch the error, but I'm not sure how to do that), but would love > to get some feedback/ideas before venturing in an RFC. > We have https://www.php.net/manual/en/features.file-upload.errors.php but in general this is not so easy to make more convenient because this runs before your PHP code starts to run, so it is not like you can stick it in a try/catch. -Rasmus --0000000000009358550593d8683e--