Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112474 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33452 invoked from network); 9 Dec 2020 18:28:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Dec 2020 18:28:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 870291804C9 for ; Wed, 9 Dec 2020 09:58:17 -0800 (PST) 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_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 ; Wed, 9 Dec 2020 09:58:16 -0800 (PST) Received: by mail-qt1-f177.google.com with SMTP id 7so1585758qtp.1 for ; Wed, 09 Dec 2020 09:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=YFmsMDADscvuHojBddRiQXe4RXCBPtD7wZtLRvKDYdQ=; b=Fbre0JBy7xhudXC8NTqWSi1/LymWn78X1+4H+Q6SFvx9nZteF2biC09uQVUF1VMG40 b0FqEAaJb6LG1xO55S+M2HRKrQ/jHYmrdy0RMRCAzJjOvxwFj+DzYC9t5o/R42N3I4QX dEegLLOW1pgYfUQhCezzqcK7kiqQl67z0TvilTMitqgvlZAzERUtE9fnLTK4y3at7/zx OZ3DCIcIgYYVOjKCtuuHWNZXp+VUsyCYUOuBeUh5X6lyeD62CQhIAynocdngDed3nz62 D8qzyzUC2gj9sWjLRn/j307KzbJqbQPEUaykLDxzk0DvzsimZbmqYu3EWXtlh1mV9oKj Altw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=YFmsMDADscvuHojBddRiQXe4RXCBPtD7wZtLRvKDYdQ=; b=ClWo2QKL9cbH3N1pXJsfA0dJzEuT26Tdv/SvHllZ4UzlCrxKPNzrHdxrr8ZyXZ6wT5 4WHwR+sZmBcfUyoDPohkb63mqtIr5RsR99PcSNyNOvJSIOR1Mk5t4bAbghcBCwXigjtN LwUDpm09phpxtEe48UNSEJPuwqc2aDp/sGzH5soVSIIZwvO7uiv/HVIfN5ZTxZPuG54+ XO+YvI1mW3EPAlfaORs04EKamdSj3qWL32e8QW3Si8ZAsDHC7U1IUy9boxZdZN390TO5 cnRpAq4rUTwxbJcIk7VQgcgo2JHJfz63cee+MOju1ADZypAiNpy8uk4YUeBeCYG3XIbd fekg== X-Gm-Message-State: AOAM5327Wl/1AtGYpu6cezO5lmeRF3Wp512jHRxduzP7qolgaA3jVXSE N+LutT0PuNztp3cWiuORgNlQFXwrDN6kk+nR X-Google-Smtp-Source: ABdhPJzZsOaqibsmW1Eagvy3EVgibArkdpLjQ/enF44LrKRKHgZzvrVqKCJhVWO/6E65Nf1DJ5pvIg== X-Received: by 2002:aed:37e2:: with SMTP id j89mr4160714qtb.239.1607536693853; Wed, 09 Dec 2020 09:58:13 -0800 (PST) Received: from [192.168.1.226] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id x185sm909161qkb.87.2020.12.09.09.58.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 09:58:12 -0800 (PST) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_1A370509-6EE8-4081-90AC-53C7172D457A" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Date: Wed, 9 Dec 2020 12:58:11 -0500 In-Reply-To: <8D795AF6-5C6B-4BB4-A773-6A7BB04503CF@cschneid.com> Cc: PHP internals To: Christian Schneider References: <8D795AF6-5C6B-4BB4-A773-6A7BB04503CF@cschneid.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [PHP-DEV] PHP 8 is_file/is_dir input handling From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_1A370509-6EE8-4081-90AC-53C7172D457A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Dec 8, 2020, at 11:27 AM, Christian Schneider = wrote: >=20 > Am 08.12.2020 um 17:16 schrieb Mike Schinkel >: >> 1. Please consider making is_file() return false for an embedded \0 = and no longer throw an exception or generate a warning. >=20 > The PR implementing this has already been merged for inclusion in PHP = 8.0.1: https://github.com/php/php-src/pull/6478 = Thanks. >=20 >> 2. Beyond is_file(), please consider allowing PHP to support both = types of error handling strategies without forcing complexity just to = use the 2nd strategy. >=20 >=20 > This is a contentious topic Exactly. > and will have to be handled on a case by case basis I guess. Which is really all I was asking for; that it be considered on a = case-by-case basis instead of just assuming that exceptions are always = preferable. > E.g. for security-related stuff a fail-early-strategy throwing an = exception might be preferable, for basic lower-level functions like = is_file() returning false was chosen to be preferable. > There is no silver bullet for all cases and having a global switch = would only make things worse. -Mike= --Apple-Mail=_1A370509-6EE8-4081-90AC-53C7172D457A--