commit f8559014257c67d826a43acde40735e8adc7f1ae
parent 7434a5a3ac31dfab736802ad4248ea46fe6042bc
Author: Jan Dankert <develop@jandankert.de>
Date: Fri, 23 Oct 2020 09:58:41 +0200
Litte optimation for displaying errors.
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/index.php b/index.php
@@ -15,14 +15,14 @@ try {
if (!headers_sent())
{
header('HTTP/1.0 500 Internal Server Error');
- header('Content-Security-Policy: style-src: inline;');
+ header('Content-Type: text/html; charset=UTF-8');
+ header('Content-Security-Policy: style-src: inline; default: self');
}
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Service currently unavailable</title>
<style type="text/css">
@@ -67,7 +67,7 @@ if (!headers_sent())
<p>Something went terribly wrong 😞</p>
- <?php // Display exceptions only in development mode, because the may contain sensitive internal information like passwords.
+ <?php // Display exceptions only in development mode, because they may contain sensitive internal information like passwords.
if (!defined('DEVELOPMENT') || DEVELOPMENT ) { ?>
<pre><?php echo $e->__toString(); ?></pre>
<?php } ?>
diff --git a/modules/cms/ui/UI.class.php b/modules/cms/ui/UI.class.php
@@ -4,6 +4,7 @@ namespace cms\ui;
use BadMethodCallException;
use cms\action\RequestParams;
+use cms\base\Language as L;
use cms\Dispatcher;
use Exception;
use template_engine\engine\TemplateRunner;
@@ -60,7 +61,7 @@ class UI
Http::noContent();
} catch (UIException $e) {
Logger::warn( $e->__toString() );
- throw new LogicException(\cms\base\Language::lang($e->key),0, $e);
+ throw new LogicException(L::lang($e->key),0, $e);
} catch (SecurityException $e) {
Logger::info($e->getMessage());
Http::noContent();