Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94528 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79062 invoked from network); 17 Jul 2016 10:44:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2016 10:44:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.162 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.162 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.162] ([81.169.146.162:34418] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/85-31884-F616B875 for ; Sun, 17 Jul 2016 06:44:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1468752236; l=2279; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=H9cKC+xsCw4Jkxgn/J9WoXDgYEmKoWFHLwxBwpy3WnY=; b=amXkCLV+2CewK2Z97Y4Ttg6Af0syML3x4BcoqZySfhxo55asjI9pivsu9jxCzScbgnu V23sMK0sAvVUtBO0ZPAK9ZpP7QokXGlRTm+7tH/H/uDDHPqiVwCruKSa/m8ySjWC5r9bK yAwsPOHggqOsxlQElXlVhFHM0BgVnrUbWU8= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtOnM6 X-RZG-CLASS-ID: mo00 Received: from mail-wm0-f50.google.com ([74.125.82.50]) by smtp.strato.de (RZmta 38.13 AUTH) with ESMTPSA id R036dcs6HAhuM3k (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Sun, 17 Jul 2016 12:43:56 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id o80so81993604wme.1 for ; Sun, 17 Jul 2016 03:43:56 -0700 (PDT) X-Gm-Message-State: ALyK8tJIhR/aIa13t9U/LUSbTaKRLOvKhBBKLtjU7w4z23AedTZIlHwxHWzKlt2Je+9vg+9iAHrahobBuPPCbA== X-Received: by 10.28.176.7 with SMTP id z7mr29344533wme.17.1468752236066; Sun, 17 Jul 2016 03:43:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.27.206 with HTTP; Sun, 17 Jul 2016 03:43:55 -0700 (PDT) In-Reply-To: References: <4cca3165052b3154eebb3a7a079c62dc@k-piste.dy.fi> Date: Sun, 17 Jul 2016 12:43:55 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Michael Vostrikov Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a1140dddc4b41f70537d28793 Subject: Re: [PHP-DEV] [RFC] New operator for context-dependent escaping From: me@kelunik.com (Niklas Keller) --001a1140dddc4b41f70537d28793 Content-Type: text/plain; charset=UTF-8 2016-07-17 12:35 GMT+02:00 Michael Vostrikov : > > > > Multiple arguments would make the syntax even cleaner: > > > > > > I thought about it. Multiple arguments do not allow runtime modification > (and make the parser more complex). > Something like this: > $context = []; > if ($field->name == 'url') $context[] = 'url'; > $context[] = 'html'; > ?> >
> Context should be defined where the variable is printed. Otherwise you move the variable from HTML text to an attribute or add it somewhere else and the context doesn't match anymore. Regards, Niklas --001a1140dddc4b41f70537d28793--