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
diff --git a/debian/patches/02-php5.4.diff b/debian/patches/02-php5.4.diff
new file mode 100644 (file)
index 0000000..99226aa
--- /dev/null
@@ -0,0 +1,26 @@
+Description: Fix for PHP 5.4.
+ PHP 5.4 seems to handle ob_end_clean() a bit different than previous
+ versions.
+Author: Sebastian Harl <tokkee@debian.org>
+
+--- a/system/core/Kohana.php
++++ b/system/core/Kohana.php
+@@ -719,7 +719,17 @@ final class Kohana {
+                       }
+                       // 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();
++                              }
++                      }
+               }
+       }