From 4dc140609ca6a13cd36cd7f95a3dce435bde9bc9 Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 29 Jun 2012 19:42:05 +0200 Subject: [PATCH] Improved 02-php5.4.diff. --- debian/patches/02-php5.4.diff | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/debian/patches/02-php5.4.diff b/debian/patches/02-php5.4.diff index 99226aa..6d389d9 100644 --- a/debian/patches/02-php5.4.diff +++ b/debian/patches/02-php5.4.diff @@ -1,26 +1,31 @@ Description: Fix for PHP 5.4. PHP 5.4 seems to handle ob_end_clean() a bit different than previous versions. -Author: Sebastian Harl +Author: Sebastian Harl , Federico --- a/system/core/Kohana.php +++ b/system/core/Kohana.php -@@ -719,7 +719,17 @@ final class Kohana { +@@ -692,10 +692,9 @@ + Event::run('system.send_headers'); + } + +- self::$output = $output; +- +- // Set and return the final output +- return self::$output; ++ // Set the final output ++ self::$output = $output; ++ return TRUE; + } + + /** +@@ -719,7 +719,7 @@ } // Store the Kohana output buffer - ob_end_clean(); -+ if (($ob_len = ob_get_length()) !== FALSE) -+ { -+ if ($ob_len > 0) -+ { -+ ob_end_flush(); -+ } -+ else -+ { -+ ob_end_clean(); -+ } -+ } ++ ob_end_flush(); } } + -- 2.30.2