Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94339 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90150 invoked from network); 30 Jun 2016 19:52:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2016 19:52:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=mails@thomasbley.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mails@thomasbley.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain thomasbley.de from 85.13.128.151 cause and error) X-PHP-List-Original-Sender: mails@thomasbley.de X-Host-Fingerprint: 85.13.128.151 dd1730.kasserver.com Received: from [85.13.128.151] ([85.13.128.151:59712] helo=dd1730.kasserver.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/B5-14264-89875775 for ; Thu, 30 Jun 2016 15:52:56 -0400 Received: from dd1730.kasserver.com (dd0802.kasserver.com [85.13.143.1]) by dd1730.kasserver.com (Postfix) with ESMTPSA id 970321A806C6; Thu, 30 Jun 2016 21:52:52 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SenderIP: 92.211.161.133 User-Agent: ALL-INKL Webmail 2.11 In-Reply-To: References: <20160620222835.BC26C1A80609@dd1730.kasserver.com> <14352177-1b49-e2ed-56a3-9a770d0ebf95@gmail.com> To: smalyshev@gmail.com, michael.vostrikov@gmail.com Cc: internals@lists.php.net, rowan.collins@gmail.com Message-ID: <20160630195252.970321A806C6@dd1730.kasserver.com> Date: Thu, 30 Jun 2016 21:52:52 +0200 (CEST) Subject: Re: [PHP-DEV] New escaped output operator From: mails@thomasbley.de ("Thomas Bley") I would prefer to have ENT_HTML5 as the default flag included, since normally all new html code is html5. Maybe split voting between 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 or not. > > Also there is a problem with function autoloading. > > > > - It is no place for such operators in the language. > It is no place for a such operators in C++, or C#, or Java. But in the most > popular language for web-programming it is very place for such operator. > > > > - There are many other contexts > > HTML is external context, but others are internal task-dependent contexts. > HTML can be used together with other contexts. > HTML context is the main context in every PHP file, and we write the beginning to switch it. > > Actually, on web page we have 3 external contexts - HTML, >script> tag, >