Code

patches: Added 02-php5.4.diff -- use ob_end_flush() in favor of ob_end_clean()
[pkg-libkohana2-php.git] / debian / patches / 02-php5.4.diff
1 Description: Fix for PHP 5.4.
2  PHP 5.4 seems to handle ob_end_clean() a bit different than previous
3  versions.
4 Author: Sebastian Harl <tokkee@debian.org>
6 --- a/system/core/Kohana.php
7 +++ b/system/core/Kohana.php
8 @@ -719,7 +719,17 @@ final class Kohana {
9                         }
10  
11                         // Store the Kohana output buffer
12 -                       ob_end_clean();
13 +                       if (($ob_len = ob_get_length()) !== FALSE)
14 +                       {
15 +                               if ($ob_len > 0)
16 +                               {
17 +                                       ob_end_flush();
18 +                               }
19 +                               else
20 +                               {
21 +                                       ob_end_clean();
22 +                               }
23 +                       }
24                 }
25         }
26