Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107359 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20705 invoked from network); 1 Oct 2019 22:46:08 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 1 Oct 2019 22:46:08 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 3B4732CB13F for ; Tue, 1 Oct 2019 13:26:51 -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 13:26:50 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id b19so23388347iob.4 for ; Tue, 01 Oct 2019 13:26:50 -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=Drh+hmG/hNcKZg48AgIIpOFRQcW5sIlmVMLlTsbB0oA=; b=KjCwMdt0qw+4FIKeTDTsOXQUmFWEvSrajak0lO1f3MiDC6jr8oiGJyUzfXlG2eGTWP 6RNTZ6OQgolqGjWHfHVK36kuFp8VwtnxfBZdP3xWjPXieihzPVonZL543GW84bNMCaWx JN1rLsQ4WK4YeDQqGa7Y0lrKI0IlUz1AZwdDfTiNXlS+PCYY6DN3ESULj2GeOPkFwmYy 91ZhLP0+JzOdDMPmTqC8mTmwEyRW2cJ9tI5l5yyxq2rGkHEwljY8gNoxlb3k0RpbIXzp tQLVx4UIMrD0e8xDe2QG5mWqsA6e+QF8QOIY6ZpWwAON8eqej3ZbCQxypakvaq+2k3rj bTDA== 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=Drh+hmG/hNcKZg48AgIIpOFRQcW5sIlmVMLlTsbB0oA=; b=EeW0e2iVCnzkrYEphBd69JBPr3FEvGwFDKnSTwTf87loj3dZga11UYQvJ+fmOJLY2U n3HMRqMLtFIdm/iOS7NbYJn7Uo/hxUMKGUn3LWLLvpiupMUWCGXozAbvZe6uW10qITzz OHF6kHaBRiO/CZzSpoLC64XEWjt5ywH/m3bXSSeTJNSmSAq+aGHwfHLc65ZdWI1OjMgZ alpB4tt4yjpw8Ti3UTKbgr+UtN3UMWU+fgH759gUMfLYWRQUM0pJUJB12pRzSAaqMvLJ Aj9dH5lym6vo/EuFJs5G2qMWSZeXfaq+k9PM+hTQnnGhGKi7PD7W1p6nMEYaK+WM5c5d /wHA== X-Gm-Message-State: APjAAAVejwsCwZNqZaIkou9lG0kCHf9ys854R15J22cqA0Fsq1oGm5ht EFmB86jJtckOD+6UGh/99in1e/j7QApYXuNADwAX+A== X-Google-Smtp-Source: APXvYqzjZi+M2EV2oWxQLLAQomIQQhKpHJBECPGr0RBvYmqIUJPd7x3iIZdg2PjXThju11w0TTw83igBN+7a8wKkZnE= X-Received: by 2002:a92:c806:: with SMTP id v6mr27416702iln.147.1569961609209; Tue, 01 Oct 2019 13:26:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 1 Oct 2019 13:26:10 -0700 Message-ID: To: Benjamin Morel Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000000748d60593df2ce2" X-Envelope-From: Subject: Re: [PHP-DEV] Error when POST / upload limits are exceeded From: rasmus@lerdorf.com (Rasmus Lerdorf) --0000000000000748d60593df2ce2 Content-Type: text/plain; charset="UTF-8" On Tue, Oct 1, 2019 at 8:25 AM Benjamin Morel wrote: > > Perhaps a more generic $_SERVER['PHP_REQUEST_STATUS'] or something along > those lines where you'd put the error message from > https://www.php.net/manual/en/features.file-upload.errors.php as well. > And add new states for these exceeded limits that aren't caught there. It > would be nice if you just needed a single check instead of having to look > for multiple things. > > Those are per-file error codes, that belong in each $_FILES entry, while > the errors I'm talking about affect the whole request, so I'm afraid you > cannot put these errors in the same place, nor can you extend the existing > error codes, as they do not have the same scope! > I know they are per-file errors. I wrote that code :) But you could still have a global status that specifies whether an error occurred or not. Then you can go look for which file it occurred on in the $_FILES array. The idea is to have a single check that tells you if everything was fine on the request. -Rasmus --0000000000000748d60593df2ce2--