From 58f35d422d6498854533ba5ef0d81f031c4a4b15 Mon Sep 17 00:00:00 2001
From: Marcel Werk
Date: Wed, 13 Jul 2016 16:24:40 +0200
Subject: [PATCH] Improved error pages / messages
---
.../templates/permissionDenied.tpl | 7 ++++--
com.woltlab.wcf/templates/userException.tpl | 23 +++++++++++++------
.../exception/IllegalLinkException.class.php | 5 ++++
wcfsetup/install/lang/de.xml | 5 ++--
wcfsetup/install/lang/en.xml | 6 +++--
5 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/com.woltlab.wcf/templates/permissionDenied.tpl b/com.woltlab.wcf/templates/permissionDenied.tpl
index 3146e91766..827bd56f28 100644
--- a/com.woltlab.wcf/templates/permissionDenied.tpl
+++ b/com.woltlab.wcf/templates/permissionDenied.tpl
@@ -1,8 +1,11 @@
{capture assign='pageTitle'}{lang}wcf.global.error.permissionDenied.title{/lang}{/capture}
+{capture assign='contentTitle'}{lang}wcf.global.error.permissionDenied.title{/lang}{/capture}
-{include file='header' __disableAds=true __disableContentHeader=true}
+{include file='header' __disableAds=true}
-{lang}wcf.global.error.permissionDenied{/lang}
+
+
{lang}wcf.global.error.permissionDenied{/lang}
+
{event name='content'}
diff --git a/com.woltlab.wcf/templates/userException.tpl b/com.woltlab.wcf/templates/userException.tpl
index 66b2f430e5..9cbf3959f2 100644
--- a/com.woltlab.wcf/templates/userException.tpl
+++ b/com.woltlab.wcf/templates/userException.tpl
@@ -1,14 +1,23 @@
-{capture assign='pageTitle'}{lang}wcf.global.error.title{/lang}{/capture}
+{if !$title|empty}
+ {capture assign='pageTitle'}{$title}{/capture}
+ {capture assign='contentTitle'}{$title}{/capture}
+{else}
+ {capture assign='pageTitle'}{lang}wcf.global.error.title{/lang}{/capture}
+ {capture assign='contentTitle'}{lang}wcf.global.error.title{/lang}{/capture}
+{/if}
+
+{include file='header' __disableAds=true}
+
+
-{include file='header' __disableAds=true __disableContentHeader=true}
-
-
- {@$message}
-
diff --git a/wcfsetup/install/files/lib/system/exception/IllegalLinkException.class.php b/wcfsetup/install/files/lib/system/exception/IllegalLinkException.class.php
index dfc7bafe76..3824cb45b6 100644
--- a/wcfsetup/install/files/lib/system/exception/IllegalLinkException.class.php
+++ b/wcfsetup/install/files/lib/system/exception/IllegalLinkException.class.php
@@ -23,6 +23,11 @@ class IllegalLinkException extends NamedUserException {
*/
public function show() {
@header('HTTP/1.0 404 Not Found');
+
+ WCF::getTPL()->assign([
+ 'title' => WCF::getLanguage()->get('wcf.global.error.illegalLink.title')
+ ]);
+
parent::show();
}
}
diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml
index 059f9246ef..e33cf030d3 100644
--- a/wcfsetup/install/lang/de.xml
+++ b/wcfsetup/install/lang/de.xml
@@ -2354,7 +2354,7 @@ Fehler sind beispielsweise:
-
+
- Was ist passiert?
@@ -2400,7 +2400,8 @@ Fehler sind beispielsweise:
-
+
+
diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml
index 3eabf5caac..8c643df697 100644
--- a/wcfsetup/install/lang/en.xml
+++ b/wcfsetup/install/lang/en.xml
@@ -2332,7 +2332,8 @@ Errors are:
-
+
+
- What happened?
@@ -2378,7 +2379,8 @@ Errors are:
-
+
+
--
2.20.1