From d7de5bf76fa1c4f38531a22bef2bc4567d1945cc Mon Sep 17 00:00:00 2001 From: real_nowhereman Date: Mon, 3 Mar 2008 09:45:48 +0000 Subject: [PATCH] buffering output to prevent issues with BOMs in lang, plugins, themes, styles --- fp-includes/core/core.language.php | 7 ++----- fp-includes/core/core.plugins.php | 2 ++ fp-includes/core/core.theme.php | 6 +++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/fp-includes/core/core.language.php b/fp-includes/core/core.language.php index 9f7c822..6d237ed 100644 --- a/fp-includes/core/core.language.php +++ b/fp-includes/core/core.language.php @@ -68,7 +68,7 @@ * capture this chars */ - //ob_start(); + ob_start(); include_once ($fpath); @@ -78,11 +78,8 @@ } - //$v = ob_get_contents(); - //ob_end_clean(); + ob_end_clean(); - // if ($v) trigger_error("[lang] $fpath produced output", E_USER_WARNING); - $GLOBALS['lang'] = array_merge_recursive($lang, $old_lang); diff --git a/fp-includes/core/core.plugins.php b/fp-includes/core/core.plugins.php index 4f6926c..0ac6381 100644 --- a/fp-includes/core/core.plugins.php +++ b/fp-includes/core/core.plugins.php @@ -99,7 +99,9 @@ if ($errno > 0){ + ob_start(); include_once($f); + ob_end_clean(); } if ($langload) diff --git a/fp-includes/core/core.theme.php b/fp-includes/core/core.theme.php index ceaad05..1b232c5 100644 --- a/fp-includes/core/core.theme.php +++ b/fp-includes/core/core.theme.php @@ -38,7 +38,9 @@ // new naming convention. Yeah, I know, just an underscore // instead of the dot, so? It is more "consistent" :D $conf2 = THEMES_DIR . THE_THEME . '/theme.conf.php'; - + + ob_start(); + if (file_exists($conf2)) { include($conf2); } elseif (file_exists($conf1)) { @@ -83,6 +85,8 @@ theme_register_default_widgetsets(); } + + ob_end_clean(); return $theme;