Add native output buffering capability.
[squirrelmail.git] / include / init.php
index 80962c357347843ac65bc96082fbcdef2afcea50..b5176403c9159a018d91d698be7e79d3bf8b4ac2 100644 (file)
@@ -19,7 +19,6 @@ FIXME: disabling this for now, because we now have $sm_debug_mode, but the probl
 //error_reporting(E_ALL);
 
 
 //error_reporting(E_ALL);
 
 
-
 /**
  * Make sure we have a page name
  *
 /**
  * Make sure we have a page name
  *
@@ -447,6 +446,19 @@ if (! sqgetGlobalVar('squirrelmail_language',$squirrelmail_language,SQ_COOKIE))
 }
 
 
 }
 
 
+/**
+ * In some cases, buffering all output allows more complex functionality,
+ * especially for plugins that want to add headers on hooks that are beyond
+ * the point of output having been sent to the browser otherwise.
+ *
+ * Note that we don't turn this on any earlier since we want to allow plugins
+ * to turn it on themselves via a configuration override on the prefs_backend
+ * hook.
+ *
+ */
+if ($buffer_output) ob_start(!empty($buffered_output_handler) ? $buffered_output_handler : NULL);
+
+
 /**
  * Do something special for some pages. This is based on the PAGE_NAME constant
  * set at the top of every page.
 /**
  * Do something special for some pages. This is based on the PAGE_NAME constant
  * set at the top of every page.