Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29070 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56908 invoked by uid 1010); 27 Apr 2007 12:55:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56892 invoked from network); 27 Apr 2007 12:55:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2007 12:55:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=jochem@iamjochem.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jochem@iamjochem.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain iamjochem.com from 194.109.193.121 cause and error) X-PHP-List-Original-Sender: jochem@iamjochem.com X-Host-Fingerprint: 194.109.193.121 mx1.moulin.nl Linux 2.6 Received: from [194.109.193.121] ([194.109.193.121:55014] helo=mx1.moulin.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/56-29041-3C2F1364 for ; Fri, 27 Apr 2007 08:55:33 -0400 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id 4C6C624D8B4; Fri, 27 Apr 2007 14:55:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at moulin.nl Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (mx1.moulin.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wAVrv9fKQpD1; Fri, 27 Apr 2007 14:55:30 +0200 (CEST) Received: from [192.168.1.22] (bspr.xs4all.nl [194.109.161.228]) by mx1.moulin.nl (Postfix) with ESMTP id 3BACD24D8AC; Fri, 27 Apr 2007 14:55:30 +0200 (CEST) Message-ID: <4631F2BC.9070405@iamjochem.com> Date: Fri, 27 Apr 2007 14:55:24 +0200 User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Antony Dovgal CC: elias , internals@lists.php.net References: <4631EE17.20400@gmx.net> <4631EFA1.4040507@zend.com> In-Reply-To: <4631EFA1.4040507@zend.com> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] http arrays From: jochem@iamjochem.com (Jochem Maas) Antony Dovgal wrote: > On 04/27/2007 04:35 PM, elias wrote: >> Hi, >> >> why has the support for http arrays (bracket syntax) been removed in >> PHP 5.1.3 ? Yes [] not allowed by according RFC, but is that a >> reason for an BC break? Is it an accident or harassment? > > What are you talking about? probably a reference to the 'correct' but rather annoying BC break in http_build_query() countless php apps make use of the ability of php to automatically convent get/post args whose names are suffixed with square brackets into [sub]arrays in the relevant superglobal array ... some of those app also make use of http_build_query() to 'cleanly' create url query parameter strings that e.g. $args = array('foo' => array('bar' => array(1,2,3), 'quz' => array(1,2,3))); echo '/foo.php?'.http_build_query($args); foo.php --- 8< --- var_dump($_GET['foo']); the var_dump() output used to be a neat nested array, but since 5.1.3 [although I remember it as 5.1.6] http_build_query() makes htmlentities of the square brackets so therefore the var_dump() gives you a string. the workable 'fix' I have been using was to postprocess http_build_query() output with the following - a 'solution' which makes my skin crawl just a little: function http_build_query_unborker($s) { return preg_replace('#%5[bd](?=[^&]*=)#ei', 'urldecode("\\0")', $s); } >