Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115006 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24645 invoked from network); 22 Jun 2021 08:41:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jun 2021 08:41:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1E6731804D0 for ; Tue, 22 Jun 2021 01:59:16 -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=0.8 required=5.0 tests=BAYES_00, GUARANTEED_100_PERCENT,HTML_MESSAGE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail1.25mail.st (mail1.25mail.st [206.123.115.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 22 Jun 2021 01:59:16 -0700 (PDT) Received: from smtpclient.apple (unknown [49.48.241.143]) by mail1.25mail.st (Postfix) with ESMTPSA id D461B60331; Tue, 22 Jun 2021 08:59:00 +0000 (UTC) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_6DE60A4A-D59B-4098-9894-5626872800D9" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Date: Tue, 22 Jun 2021 15:58:57 +0700 In-Reply-To: Cc: Benjamin Morel , Derick Rethans , PHP Internals , Yasuo Ohgaki To: Craig Francis References: <0CD1762E-6094-4DEB-B1B5-22CFBDAAFF44@php.net> X-Mailer: Apple Mail (2.3654.100.0.2.22) Subject: Re: [PHP-DEV] [RFC] is_trusted - was is_literal From: php-lists@koalephant.com (Stephen Reay) --Apple-Mail=_6DE60A4A-D59B-4098-9894-5626872800D9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 22 Jun 2021, at 06:28, Craig Francis = wrote: >=20 > On Tue, 22 Jun 2021 at 12:18 am, Benjamin Morel = > > wrote: >=20 >> On Tue, 22 Jun 2021 at 01:06, Derick Rethans wrote: >>=20 >>> On 21 June 2021 23:37:56 BST, Yasuo Ohgaki = wrote: >>>>=20 >>>> The name "is_trusted" is misleading. >>>> Literal is nothing but literal. >>>=20 >>> I agree with this. The name is_trusted is going to be the same = naming >>> mistake as "safe mode" was. Developers will put their trust in it = that it >>> is 100% guaranteed safe. >>=20 >>=20 >> FWIW, agreed, too. Trusted is vague and may imply some false sense of >> security. Literal is literally what it says on the tin. >>=20 >=20 >=20 > I can follow up properly tomorrow, but by popular request we do = support > integers as well (could be seen as stretching the definition of = =E2=80=9Cliteral=E2=80=9D a > bit). >=20 > And we did ask for suggestions last week, which ended up with a vote = (as I > couldn=E2=80=99t decide). >=20 > That said, I=E2=80=99m really glad that the only issue we seem to have = is the name. >=20 > Craig So I just want to make sure I understand the progression on this so far. It started out with people wanting a way to check that a string was a = literal string, in code somewhere, and does not come from user input. Ok = makes sense. The name makes sense too. Then someone said they wanted to check if an integer was a literal too - = but because of technical limitations, it now allows any integer, = regardless of where it came from, to be treated as a literal. Then because it=E2=80=99s not actually checking for literals, people = thought the name =E2=80=9Ctrusted=E2=80=9D made more sense? That nobody thinks =E2=80=9Cany user supplied integer must be surely = safe=E2=80=9D is kind of hilarious, and sad at the same time. Knowing that a string is literal would be very helpful. Knowing that the = string potentially still contains user input, in spite of the one thing = it claims to do, is not just unhelpful, it makes the entire thing = useless. I can=E2=80=99t vote, but this whole thing would be a No from me unless = it was the original scope - a variable is a literal defined in code = somewhere. If there are technical limitations with some types, then = leave them off the list of what it will check. --Apple-Mail=_6DE60A4A-D59B-4098-9894-5626872800D9--