Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75189 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48217 invoked from network); 3 Jul 2014 05:36:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2014 05:36:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.45 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.45 mail-qa0-f45.google.com Received: from [209.85.216.45] ([209.85.216.45:42206] helo=mail-qa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/D1-47713-DDBE4B35 for ; Thu, 03 Jul 2014 01:36:29 -0400 Received: by mail-qa0-f45.google.com with SMTP id v10so9817574qac.32 for ; Wed, 02 Jul 2014 22:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Q7bEIJagA4ubNKtzGBkdyiZtSlN2/qKFDYs4JTMBtLM=; b=K8QSa4K3FnGkEHpamDuRUSPV9442aXmZTevhRqQyA9VPCxpT24X2Wxz4hzVX45NCtu afbDeWOheOdt2QjIX5zTc/Q6e4MwXdzrDuZG9AFGyVt5zAll+CZbH7d5cmZHmT4XTvbe Ns9q4QdFSU3RlZ5JUyGxso7bqqdKZLyg0/2mYcA9IQ9XSJF2iijT4CAEOjc2Z/jhiWFX eO5glnOxNj40QQUjb+MYu8erSWloYL7s6zdMF6Jfdc0UYHqIHibuI/mJ2+Wdb0l03yTB NEAlhUFZcPgWl9npzPD3HADLTggihhN0J3d7bq1uOd5KNsFUmKYceanrhRIK7D8E3cJr Zthg== MIME-Version: 1.0 X-Received: by 10.140.92.167 with SMTP id b36mr3444525qge.97.1404365786656; Wed, 02 Jul 2014 22:36:26 -0700 (PDT) Received: by 10.140.47.175 with HTTP; Wed, 2 Jul 2014 22:36:26 -0700 (PDT) In-Reply-To: References: <20140703003646.GA12662@openwall.com> <53B4AC6E.5050401@sugarcrm.com> <20140703012402.GA13015@openwall.com> Date: Thu, 3 Jul 2014 07:36:26 +0200 Message-ID: To: Adam Harvey Cc: Solar Designer , Andrea Faulds , Stas Malyshev , PHP internals , D0znpp Content-Type: multipart/alternative; boundary=001a1139c3a2d939fc04fd43631d Subject: Re: [PHP-DEV] multiline HTTP headers support in header() From: tyra3l@gmail.com (Ferenc Kovacs) --001a1139c3a2d939fc04fd43631d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Jul 3, 2014 at 3:29 AM, Adam Harvey wrote: > On 2 July 2014 18:24, Solar Designer wrote: > > On Thu, Jul 03, 2014 at 02:09:05AM +0100, Andrea Faulds wrote: > >> On 3 Jul 2014, at 02:05, Stas Malyshev wrote: > >> > So IE violates the RFC by misparsing the multiline headers? I'd say > it's > >> > an one more reason to never use IE :) RFC 7230 indeed proposes to > remove > >> > this capability, but it's not accepted yet, as far as I can see. We > can > >> > probably drop this immediately for 5.6, for previous versions I'm no= t > >> > sure if anybody uses this feature. So if anybody knows any use of it= , > >> > please tell, otherwise it's probably a good idea to kill it for stab= le > >> > versions too. > >> > >> As I?ve had to implement HTTP myself for a particular non-PHP > application, I?ve read the original HTTP/1.1 RFC. As far as I know, > multi-line headers are semantically equivalent to single-line headers, so > couldn?t we just ?flatten? them automatically? It shouldn?t break anythin= g > unless you?re deliberately misusing header(). > > > > I think we could, and your analysis looks correct to me, but I see no > > good enough reason to go for the extra complexity. Having a function > > defined in a more complicated manner and implemented with more code is > > asking for more bugs and mis-interactions. > > I'd tend to agree: if we're going to do this, let's just rip the > band-aid off completely. I've got a quick and dirty patch at > > https://github.com/LawnGnome/php-src/compare/remove-multiline-headers?exp= and=3D1 > that does this, and applies cleanly against every branch from 5.4 to > master. > > I'm not so sure about the versions this should be applied too, though: > my current inclination is to only apply it to master and maybe 5.6 if > the RMs agreed. While it's a very, very small BC break (and hence one > I'm OK with in a minor branch like 5.6), I don't think we should do > this in a 5.4 or 5.5 point release =E2=80=94 recent history (the unserial= ize() > hack) suggests that it's a nightmare to document and explain those > sorts of breaks. > > Adam > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > If I'm reading this correctly this would reintroduce https://bugs.php.net/bug.php?id=3D60227 those checks aren't there to support header splitting but to prevent them, as "\r\n" isn't the only separator which will cause browsers to split the header. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a1139c3a2d939fc04fd43631d--