prevent output in plugins/*/setup.php files.
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Jan 2006 09:33:56 +0000 (09:33 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Jan 2006 09:33:56 +0000 (09:33 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10536 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/plugin.php

index 4006276bede6f96849c1ff2972d05014fc4f67eb..379aa68bf45160d22506afebb05bb32913487330 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -515,6 +515,8 @@ Version 1.5.1 -- CVS
   - Added 'mail' and 'sn' attributes to address book LDAP backend search
     expression (#1368154).
   - Added mailbox caching code by Michael Long.
+  - Prevent output of whitespace during plugin activation. Fixes possible 
+    attachment corruption by incorrectly coded plugins.
 
 Version 1.5.0 - 2 February 2004
 -------------------------------
index 8cf261b73cb23d3d3d47c77f16b42d4d84ec42a2..7ccc6bc99339923e9c52dcbcef9b6080d15de80c 100644 (file)
@@ -220,9 +220,18 @@ function is_plugin_enabled($plugin_name) {
 
 /* On startup, register all plugins configured for use. */
 if (isset($plugins) && is_array($plugins)) {
+    // turn on output buffering in order to prevent output of new lines
+    ob_start();
     foreach ($plugins as $name) {
         use_plugin($name);
     }
+    // get output and remove whitespace
+    $output = trim(ob_get_contents());
+    ob_end_clean();
+    // if plugins output more than newlines and spacing, stop script execution.
+    if (!empty($output)) {
+        die($output);
+    }
 }
 
 ?>
\ No newline at end of file