From: Federico Date: Fri, 29 Jun 2012 17:42:05 +0000 (+0200) Subject: Improved 02-php5.4.diff. X-Git-Tag: libkohana2-php-2.3.4-2~2 X-Git-Url: https://git.tokkee.org/?p=pkg-libkohana2-php.git;a=commitdiff_plain;h=4dc140609ca6a13cd36cd7f95a3dce435bde9bc9 Improved 02-php5.4.diff. --- 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(); } } +