public function __construct($message, $code = null, $previous = null)
{
parent::__construct(strip_tags($message), $code, $previous);
$html = self::$html;
$info = self::$info;
$output = str_replace('%error_title%', 'Bolt - Fatal error', $html);
$message = nl2br($message);
$output = str_replace('%error%', $message, $output);
$output = str_replace('%info%', $info, $output);
// TODO: Information disclosure vulnerability. A misconfigured system
// will give an attacker detailed information about the state of the
// system.
// Suggested solution: in the config file, provide a whitelist of hosts
// that may access the self-configuration functionality, and only
// expose the information to hosts on the whitelist.
// Determine if we're on the command line. If so, don't output HTML.
if (php_sapi_name() === 'cli') {
if ($previous instanceof \Exception) {
$output .= "\n\nException message:\n" . $previous->getMessage() . "\n\n";
}
$output = self::cleanHTML($output);
}
self::$screen = $output;
}