Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115037 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4630 invoked from network); 22 Jun 2021 17:53:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jun 2021 17:53:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A53B1804CC for ; Tue, 22 Jun 2021 11:11:19 -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.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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, 22 Jun 2021 11:11:18 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id r5so37479571lfr.5 for ; Tue, 22 Jun 2021 11:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; h=mime-version:from:date:message-id:subject:to; bh=mud1V0RPdL2ZoE3pfbwjcpID3cySyXVVx+7MwmUow5E=; b=KrJo28QRxFWC+gG4mmK7CANn6F7HPpeb6NPkssGgDDLGnRJF1RElNNobKNoBy6MN5o IHNIWPyHBuhfN0xWGcKNvrRe13yMFxEZ3wdILmKmQqa7hPFEZGqNMkj5SYGogCuPrdpW npXulJJYUqnEvVQNh2K2f/8C6fMPsVd57Jz4M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=mud1V0RPdL2ZoE3pfbwjcpID3cySyXVVx+7MwmUow5E=; b=rpwbpOm6hFtT+nanLmfj5Z/DPZSATd7jkkWDY+daioOi8npJAmIiqehw246gvoVhW4 RdSehfq3Q4J277lHVda3TgzPqSrRgy/LHUbDbxsCruzf3OHwarheJBFZnIF6+Y/B8YFA NxzX+hCUUYBN8Iw8W8G3vBRn7qibAB3NeZBHpPfcpKiIYi7hLpg6h5dd6jTeVJh++92K mMK1wjm5bEwT7DvBbphLiJoexar0LCt5Lrx+Vbmq0HsgHNRrjXo7/1UwaX+EDyy4MLPP iuaDcTzivH0Aw6xEM/P5dsDaMNFjA+im0akb8PDokefjl70I+VrvRmxbO7WPQGVoyOvc IrNw== X-Gm-Message-State: AOAM530SYdNXHVsjg2oYp20w9Qq/OsCAH3lI2FRHBPMHcsMW60W9AYSB 1f/aXbJ2/kKyusxwAYsEZ3FLqlPJd3KmHiZq40xwdPBhhdzRwFDQ X-Google-Smtp-Source: ABdhPJzD9h9YKGWM4eYnIUkBozJSEuEcUOW0e0tuAnYxzrGAK5f0ggtw6XW8hdA4oCdQmTX5o7R3SuezRb+C9IzKTm4= X-Received: by 2002:ac2:548e:: with SMTP id t14mr3791084lfk.617.1624385476006; Tue, 22 Jun 2021 11:11:16 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 22 Jun 2021 19:11:05 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000046a3e105c55eb71d" Subject: [PHP-DEV] [RFC] Name issue - is_literal/is_trusted From: craig@craigfrancis.co.uk (Craig Francis) --00000000000046a3e105c55eb71d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Internals, As the name `is_trusted()` seems to be causing contention, I think more than the alternative option would. Since we want to get this right, and we still have time before the feature freeze, this might be worth re-looking at. Particularly if you are one of those unsure about it, read on. The name `is_trusted()` was chosen by a community vote over several days. While I=E2=80=99m of a similar opinion that "trusted" might be misleading f= or some in the strength of its word, I do not want to simply override 18 of the 21 people, who I assume read the RFC, asked questions to clarify on the mailing list, understood how it works, and have chosen that name. However, clearly some people missed the vote and its discussion time, and some voted but then perhaps wanted clarifying on what the RFC was fully about later. If we say that's about five people, then assuming there is a larger audience who reads but does not post (as the voting numbers indicated) then I'm inclined to guesstimate that maybe that means 3x the number of people share those feelings. And with that number it starts to feel like maybe we should double-check here. While a one-word name is always going to be misunderstood by some people, we want to be as clear as possible. The Function: - Is a security-based function that prevents Injection Vulnerabilities in PHP. - Flags strings written by the developer, including when concatenated. - Also accepts integer values, which as purely numerical cannot contain code/dangerous characters. (Due to technical limitations within PHP, it's not possible for these to be flagged as user or developer in the codebase itself without performance issues). (RFC for full breakdown: https://wiki.php.net/rfc/is_literal) Ideally we want a one-word name that suggests this as best we can - one word to be consistent with other `is_*()` functions. - `is_literal()` was my original placeholder name. However, given that it's not just literal strings, but also supports concatenation and integers I felt it may be misleading with the definition of 'literal' stretched so far it might get confusing, and is why I didn't include my original name for it in the poll. However, if you feel it would be more accurate my mind isn't fixed on it. - `is_known()` - suggested by Joe, who created the implementation, was one of two options in the original vote, and was based on the principle that the value be 'known' to the developer to be free from external code and be within a 'known' understanding of the values that should be going in it. - `is_trusted()` - suggested by Moritz and separately by Mike, was the second option in the original vote, and was based on the idea that what is returned can be 'trusted' to be free from external code. I suggest that people who are serious in their feelings about this, offer the name that they would prefer (including potentially making one themselves that fits the RFC content and style mentioned above) so we can assess whether the current name needs a second look. Thanks, Craig --00000000000046a3e105c55eb71d--