X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fplugin.php;h=5be3a953b8bd85f7ff7ebb419175e8c7a8d24a45;hb=47ccfad452e8d345542d09e59112cac317cffed8;hp=0b50ce39e50075a62bfcbb14d5594b5569f63357;hpb=4b4abf93a9624311afef0c385023724ee46a2b60;p=squirrelmail.git diff --git a/functions/plugin.php b/functions/plugin.php index 0b50ce39..5be3a953 100644 --- a/functions/plugin.php +++ b/functions/plugin.php @@ -7,7 +7,7 @@ * * Documentation on how to write plugins might show up some time. * - * @copyright © 1999-2005 The SquirrelMail Project Team + * @copyright © 1999-2006 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -198,7 +198,13 @@ function soupNazi(){ function is_plugin_enabled($plugin_name) { global $plugins; - if (! isset($plugins) || ! is_array($plugins) || empty($plugins)) + /** + * check if variable is empty. if var is not set, php empty + * returns true without error notice. + * + * then check if it is an array + */ + if (empty($plugins) || ! is_array($plugins)) return false; if ( in_array($plugin_name,$plugins) ) { @@ -214,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