From: Gonçalo Queirós Date: Fri, 29 Oct 2010 17:12:22 +0000 (+0100) Subject: Bug #9351: Don't try to include non existent vhost specific files X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d01eaa60b8a3fd37c1ad7607e181554cc76f0648;p=horde.git Bug #9351: Don't try to include non existent vhost specific files Signed-off-by: Michael M Slusarz --- diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 8ffce1379..25af46634 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -765,19 +765,21 @@ HTML; : $conf['server']['name']; $file = $config_dir . substr($config_file, 0, -4) . '-' . $server_name . '.php'; - self::startBuffer(); - $success = (is_null($var_names) && !$show_output) - ? include_once $file - : include $file; - $output = self::endBuffer(); + if (file_exists($file)) { + self::startBuffer(); + $success = (is_null($var_names) && !$show_output) + ? include_once $file + : include $file; + $output = self::endBuffer(); + + if (!$success) { + throw new Horde_Exception(sprintf('Failed to import configuration file "%s".', $file)); + } elseif (!empty($output) && !$show_output) { + throw new Horde_Exception(sprintf('Failed to import configuration file "%s": ', $file) . strip_tags($output)); + } - if (!$success) { - throw new Horde_Exception(sprintf('Failed to import configuration file "%s".', $file)); - } elseif (!empty($output) && !$show_output) { - throw new Horde_Exception(sprintf('Failed to import configuration file "%s": ', $file) . strip_tags($output)); + $was_included = true; } - - $was_included = true; } // Return an error if neither main or vhosted versions of the config