From 6f9876690af9115ecd9af8ceaecfbdd4b987ed61 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 09 Apr 2008 05:03:37 -0400
Subject: [PATCH] #1484624: do ob_start/ob_end_clean when reading config files

---
 program/include/main.inc |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/program/include/main.inc b/program/include/main.inc
index 1d35682..5c25f7f 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -52,6 +52,10 @@
   global $sess_id, $sess_user_lang;
   global $CONFIG, $INSTALL_PATH, $BROWSER, $OUTPUT, $_SESSION, $IMAP, $DB, $USER;
 
+  // start output buffering, we don't need any output yet, 
+  // it'll be cleared after reading of config files, etc.
+  ob_start();
+
   // check client
   $BROWSER = rcube_browser();
 
@@ -80,6 +84,9 @@
   // use database for storing session data
   include_once('include/session.inc');
 
+  // clear output buffer
+  ob_end_clean();
+
   // init session
   session_start();
   $sess_id = session_id();
@@ -101,7 +108,6 @@
   // overwrite config with user preferences
   $CONFIG = array_merge($CONFIG, (array)$USER->get_prefs());
 
-
   // reset some session parameters when changing task
   if ($_SESSION['task'] != $task)
     unset($_SESSION['page']);
@@ -113,13 +119,11 @@
   if ($task=='mail')
     rcmail_imap_init();
 
-
   // set localization
   if ($CONFIG['locale_string'])
     setlocale(LC_ALL, $CONFIG['locale_string']);
   else if ($sess_user_lang)
     setlocale(LC_ALL, $sess_user_lang);
-
 
   register_shutdown_function('rcmail_shutdown');
   }

--
Gitblit v1.9.1