Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112339 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 82261 invoked from network); 1 Dec 2020 18:20:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Dec 2020 18:20:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E67A21804C0 for ; Tue, 1 Dec 2020 09:48:02 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 ; Tue, 1 Dec 2020 09:48:02 -0800 (PST) Received: by mail-ed1-f46.google.com with SMTP id y22so4575790edv.1 for ; Tue, 01 Dec 2020 09:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3wAYAJcdh2djVBOF9/0sXCWc04BxIpke8sxc79GWrPI=; b=fN7ZfuFiNidK8130YJyX8TtCGyyxcZyWZy0irzwky+gcsWTFRbrVvkbdkFRSl1arzH cr31W/QcXq1Fk426lQ28iLxlqzWpKcRCXyaFqt1zv7jl3ZLg7F8kd0r8zY8GwifL6LUB zcFO1USFklVleVdNJ8jD0G4Pswszwdfh/BZ12z93BMwovnTpOdXGDFJ4tuCdryp7DNfC 0XwP2ss3L7z5tN1ww0IgW61oljrW8W+p5K7gFArjkCcOafka/lhvyFm7WpusxKwMljXc Kj6c7hEd3GFYrIvDn4IV9NP3fAnHW0gNS688Hk9Pd6/dG1CvfsNq8C3IEcjRjJGtqjMu 4QgA== 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=3wAYAJcdh2djVBOF9/0sXCWc04BxIpke8sxc79GWrPI=; b=qxowzot2LJaMCUbVvMdQLbDXZefZUKKrWOPDTqOopDyV82nHTI3TEn7jL6JL0d36hQ tM0nj+1aTbkl84ScyeAc+eXkUfLH3Z1H8vAKT2dowbkXZ+2v/x2OiNccYOpHPa+FCYlf kepYbwWF96pw31/a8RO26cRGIRQqRUtyDYlN6Up0D90nnkseqcn682RFJxogtjUWyYf9 G1/tDN+4yJsRGNO1GVoOfF3Ruh41rMzMmZfpNi7zTWJYncK4mWcNN3a/YGtSHkGXMO6P cbn5b2cEtlnstkhTz3GoP4KOJ9JuQ34C5uMjiBwBft356RpDTrPP4mlxOdk3O+mEkToX EPiQ== X-Gm-Message-State: AOAM532SAGW6ZQXcd4vdudjOqgNbxd+K1J7LL3CDbuWONGapkBy02zZt nknoiHzDPjHg3lap00s4N4zzOvteN811xPKCdBw= X-Google-Smtp-Source: ABdhPJxWnX6Fj4vk3xzu2ZBNVweXAfzvfdOlT1/I5XppmbO8qIvMg3vEL8KW/4j+Mm3p/Gfd62NyCPvkP2gBUjIRdrw= X-Received: by 2002:a05:6402:1713:: with SMTP id y19mr4265505edu.122.1606844881160; Tue, 01 Dec 2020 09:48:01 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 1 Dec 2020 17:47:47 +0000 Message-ID: To: Paul Crovella Cc: "Christoph M. Becker" , "Aimeos | Norbert Sendetzky" , PHP internals Content-Type: multipart/alternative; boundary="00000000000059cf3a05b56aba21" Subject: Re: [PHP-DEV] Re: PHP 8 is_file/is_dir input handling From: george.banyard@gmail.com ("G. P. B.") --00000000000059cf3a05b56aba21 Content-Type: text/plain; charset="UTF-8" On Tue, 1 Dec 2020 at 17:46, G. P. B. wrote: > On Tue, 1 Dec 2020 at 17:45, Paul Crovella > wrote: > >> On Tue, Dec 1, 2020 at 9:25 AM Christoph M. Becker >> wrote: >> > >> > On 01.12.2020 at 18:18, Aimeos | Norbert Sendetzky wrote: >> > >> > > PHP 8 is stricter in checking input data then PHP 7. This is good but >> > > has some side effects for is_file(), is_dir() and similar functions >> when >> > > invalid paths are passed for checking. >> > > >> > > In PHP 7, this returns FALSE: >> > > >> > > php -r 'var_dump(is_file("ab\0c"));' >> > > >> > > In PHP 8, the same code throws a ValueException. Problem is now that >> > > it's not possible to check upfront if the passed argument is a valid >> > > path to avoid the exception being thrown. >> > >> > This is only about the NUL byte in the filename. You can easily check >> > for that yourself. :) >> > >> > Regards, >> > Christoph >> >> Or is_file could check for it, handle it gracefully, and be a safe >> function to call without worrying about this undocumented edge case. >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: https://www.php.net/unsub.php >> >> > Apologize my email client sent by mistake: But this has always generated a warning see: https://3v4l.org/7E2mv So this is not new behaviour. George P. Banyard > --00000000000059cf3a05b56aba21--