Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75187 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30655 invoked from network); 3 Jul 2014 01:29:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2014 01:29:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=adam@adamharvey.name; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=adam@adamharvey.name; sender-id=pass Received-SPF: pass (pb1.pair.com: domain adamharvey.name designates 209.85.223.175 as permitted sender) X-PHP-List-Original-Sender: adam@adamharvey.name X-Host-Fingerprint: 209.85.223.175 mail-ie0-f175.google.com Received: from [209.85.223.175] ([209.85.223.175:52976] helo=mail-ie0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/7F-47713-DF1B4B35 for ; Wed, 02 Jul 2014 21:29:34 -0400 Received: by mail-ie0-f175.google.com with SMTP id tp5so9812187ieb.6 for ; Wed, 02 Jul 2014 18:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamharvey.name; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=m+5B+H9W0ufvZWC+89Ayr7YCuGfRdShA7HnzaBnSnCM=; b=ACNhQWSsb35HcRein0ZQ/iOeWOOYFjaY+XIedZlOWJgQSvIKQQ9YHzN1we0DSIDyXS 9l67dSXhtvwu2GplJ7M4doW/hEd4+ahl3ao2aDvxdjVkPIc2i3lYaMltn3NLaynuo4rR rUdI+423V9wdd/6aZojh3PtfNsHsoebeo2Kew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=m+5B+H9W0ufvZWC+89Ayr7YCuGfRdShA7HnzaBnSnCM=; b=LL0fVMHrjLCr4g1zygU8N5jrzqRj5KW9Jfe56fHKJn9+RNwT4LVIh1Ps9sjaEkxZo1 x6fYQ9xFszfqALtS4Dj+ib0NZogrHpqc8SaHJlb/ZicBIWTk7DxGi2Gax2yRymA84uap yP4hN1ecj/7pjION+ADEXgU+z9mhORT4wJM5GAoGAMVos+OKTudVcb0hw2KSHznaheaY YqdYkeQ8swrIJ7vDZmQWtTwftJ4gEq0vg1XnvhqpRVHXz00Rc0/n0hx8WA/RQJ63UHWN N6AHNgpPF7wyyYCa4V9BjpQFSTHta9487RNy9t1D4VJAKHXRJBkBzGFSb3Tl1YcEfqtt /BdQ== X-Gm-Message-State: ALoCoQmkmDA/WZI02RpOiChM4nysbU7DBA5qOc2V3geakRs5pep9A2jWQRso3KsKqbfekH30h+As X-Received: by 10.43.7.73 with SMTP id on9mr6794709icb.51.1404350971391; Wed, 02 Jul 2014 18:29:31 -0700 (PDT) MIME-Version: 1.0 Sender: adam@adamharvey.name Received: by 10.42.78.202 with HTTP; Wed, 2 Jul 2014 18:29:11 -0700 (PDT) In-Reply-To: <20140703012402.GA13015@openwall.com> References: <20140703003646.GA12662@openwall.com> <53B4AC6E.5050401@sugarcrm.com> <20140703012402.GA13015@openwall.com> Date: Wed, 2 Jul 2014 18:29:11 -0700 X-Google-Sender-Auth: 4Pgf-lmzRgaoeBN_EowXxxCKPX8 Message-ID: To: Solar Designer Cc: Andrea Faulds , Stas Malyshev , PHP internals , D0znpp Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] multiline HTTP headers support in header() From: aharvey@php.net (Adam Harvey) 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 remo= ve >> > this capability, but it's not accepted yet, as far as I can see. We ca= n >> > probably drop this immediately for 5.6, for previous versions I'm not >> > 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 stable >> > versions too. >> >> As I?ve had to implement HTTP myself for a particular non-PHP applicatio= n, I?ve read the original HTTP/1.1 RFC. As far as I know, multi-line header= s are semantically equivalent to single-line headers, so couldn?t we just ?= flatten? them automatically? It shouldn?t break anything unless you?re deli= berately 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?expan= d=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 unserializ= e() hack) suggests that it's a nightmare to document and explain those sorts of breaks. Adam