Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57816 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97809 invoked from network); 13 Feb 2012 08:54:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2012 08:54:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=releaze3@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=releaze3@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: releaze3@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:42907] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/E0-27081-5DFC83F4 for ; Mon, 13 Feb 2012 03:54:46 -0500 Received: by wgbdq12 with SMTP id dq12so4287405wgb.11 for ; Mon, 13 Feb 2012 00:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=wIMlcIpqNAxZffckjbaftPa8OKPjQwh2eVt4b3AzVTY=; b=x/PetHdbOvT8XiO5xRBNjVH0FXW8li/YfTiNDWICPjeTkNLIdSpIQC9j1bi7gAjzyI qVnmLiNeGQJ+xAhJ6VJmgnZgsGhyRNI7EtfSiARgV50PWWF7lReWhFVBgn2uXAaPyjnz Ncl/zfIH4DSKyzagV6TaN7x31qzIuwOEJ6k7c= Received: by 10.216.145.1 with SMTP id o1mr4358952wej.45.1329123283271; Mon, 13 Feb 2012 00:54:43 -0800 (PST) Received: from [192.168.1.42] ([197.169.176.194]) by mx.google.com with ESMTPS id cs4sm44744138wib.8.2012.02.13.00.54.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Feb 2012 00:54:42 -0800 (PST) Message-ID: <4F38CFCE.7000508@gmail.com> Date: Mon, 13 Feb 2012 10:54:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: PHP Internals Content-Type: multipart/mixed; boundary="------------010300070200040705060908" Subject: main/output.c problem From: releaze3@gmail.com (James Edmunds) --------------010300070200040705060908 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The new output buffering mechanism has a compatibility function for people / extensions that use the "old way". There is a compatibility function php_output_handler_compat_func(). It is not quite as compatible as it should be, and any code that depends on it will break. Using the "old way" if the output handler function set the return buffer pointer to NULL, it was a signal to the output code to pass through the buffer contents unmodified. The compatibility function wasn't doing that. The patch below fixes that. Sorry if this message doesn't follow normal procedures, I have very limited time and wanted to make sure I reported this before 5.4 ships. Hopefully the powers that be will considering including it. Thanks in advance. --------------010300070200040705060908 Content-Type: text/plain; name="output.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="output.diff" Index: main/output.c =================================================================== --- main/output.c (revision 323171) +++ main/output.c (working copy) @@ -1261,10 +1261,16 @@ if (func) { uint safe_out_len; + char *safe_output_buffer = NULL; - func(output_context->in.data, output_context->in.used, &output_context->out.data, &safe_out_len, output_context->op TSRMLS_CC); - output_context->out.used = safe_out_len; - output_context->out.free = 1; + func(output_context->in.data, output_context->in.used, &safe_output_buffer, &safe_out_len, output_context->op TSRMLS_CC); + if (NULL == safe_output_buffer) { + php_output_context_pass(output_context); + } else { + output_context->out.data = safe_output_buffer; + output_context->out.used = safe_out_len; + output_context->out.free = 1; + } return SUCCESS; } return FAILURE; --------------010300070200040705060908--