Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94338 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88350 invoked from network); 30 Jun 2016 19:35:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2016 19:35:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=michael.vostrikov@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=michael.vostrikov@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.172 as permitted sender) X-PHP-List-Original-Sender: michael.vostrikov@gmail.com X-Host-Fingerprint: 209.85.220.172 mail-qk0-f172.google.com Received: from [209.85.220.172] ([209.85.220.172:33646] helo=mail-qk0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/55-14264-D6475775 for ; Thu, 30 Jun 2016 15:35:10 -0400 Received: by mail-qk0-f172.google.com with SMTP id o76so51316917qke.0 for ; Thu, 30 Jun 2016 12:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xyr16/D08aIZHiZ8l0KoC5/vGBBqHZa3UkKMxsCo4/8=; b=PcGo6msTj7+t6rwVlmELOyu1R2di0bHvcG/MOLnerw7q/U066s4PTetG6akZVnysGv w1Kchc0na8MYR07R0sfWMzUHuijwQ8R/OQcDqrk9zlOi+iFypnUpqawhlGrbyOkDlqmt 66TE0a3cUginNjrsaI7KsaSjENY3nhPpwGvOfi3ZJ+0OxT+DYaFTiIIGN9iYcBOIm5mL Rhs4ZosbSqpbQrDEPBb3ry3X+fjunaQNup19GJPGhKCBGYV43+F6HZ7g8Vg6OWS5a8yy J0tJUGSX+kv2KbzEg4uWWCy0RiwYWxAst58thDk87FJQS4VTQHlFo2yHvhe2COd7biGE DVpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xyr16/D08aIZHiZ8l0KoC5/vGBBqHZa3UkKMxsCo4/8=; b=YaJ/GH7so8ZDPqfHodmBvKrLG1DynTKX24spbiGoL8QLcPC7peqt3zxFttnU2I8sQM CMqi0hTtXAf1NtrUNN+kKsUfjh2I2r8lDgsJzNGWInQnGoh2SaxeC4i502u7rAgGP63K ELSWTWvFn2feXzJxTdowJuBLCYD2Jq9CvDygnxlRRsMNko64fsE53akk231dFBnvcbq8 FHgOGbPFXvJmKPMcZcxtsSVg7HG1rLAhmzZH/27wUrmuT1oEjti4Ru226bYDHFtSzS25 nzQ0CT9BZNSMdpR6cnjVmokvXfjxF5GIIMkejw6LpMcTShene/IrvTsscFqtvTfHMbQP S6yg== X-Gm-Message-State: ALyK8tLIWBQeuFaTQJY3/+STQGmJr1xfPORbbvqbZ11AeKe9bsUlRbm7vxKT7vq5CYepSIh1CQu0C+F5Cn2FOQ== X-Received: by 10.55.24.215 with SMTP id 84mr21758346qky.51.1467315307260; Thu, 30 Jun 2016 12:35:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.53.71 with HTTP; Thu, 30 Jun 2016 12:35:06 -0700 (PDT) In-Reply-To: References: <20160620222835.BC26C1A80609@dd1730.kasserver.com> <14352177-1b49-e2ed-56a3-9a770d0ebf95@gmail.com> Date: Fri, 1 Jul 2016 00:35:06 +0500 Message-ID: To: Stanislav Malyshev Cc: Thomas Bley , PHP Internals , rowan.collins@gmail.com Content-Type: multipart/alternative; boundary=001a113b9dc4a9b2eb053683f75a Subject: Re: [PHP-DEV] New escaped output operator From: michael.vostrikov@gmail.com (=?UTF-8?B?0JzQuNGF0LDQuNC7INCS0L7RgdGC0YDQuNC60L7Qsg==?=) --001a113b9dc4a9b2eb053683f75a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I've tried to gather all arguments for and against. To be clear. I suggest new operator like '' which is equivalent of . It is only for HTML context. Flag combination is taken from most popular frameworks - Symfony, Zend, Yii, and Twig. Of course, exact form of operator and default flags are the details of implementation. - You can write short function in userland. The problem is not that we have no function. The problem is that the same action is always repeated, and if we don't repeat it then it leads to security problems. More than 90% of output data - is data from DB and must be HTML-encoded. There is no such problem with other contexts. If we don't call json_encode when passing an array or object into javascript, this only breaks the script, and it will be noticeable, there won't be security problems. With new operator we can write or , or , they are mutually exclusive, and we need specially write one or another, but with helper function we have the same beginning tag,