From f40d37ad480921df12d994014122880ea20ec095 Mon Sep 17 00:00:00 2001 From: Peter Jaszkowiak Date: Fri, 8 Sep 2017 13:23:30 -0600 Subject: [PATCH] Fix #5922 --- public/language/en-GB/error.json | 1 + src/controllers/helpers.js | 2 +- src/views/400.tpl | 2 +- src/views/403.tpl | 2 +- src/views/500-embed.tpl | 2 +- src/views/500.tpl | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/language/en-GB/error.json b/public/language/en-GB/error.json index 8d106b6a79..f970199f32 100644 --- a/public/language/en-GB/error.json +++ b/public/language/en-GB/error.json @@ -5,6 +5,7 @@ "not-logged-in": "You don't seem to be logged in.", "account-locked": "Your account has been locked temporarily", "search-requires-login": "Searching requires an account - please login or register.", + "goback": "Return to the previous page", "invalid-cid": "Invalid Category ID", "invalid-tid": "Invalid Topic ID", diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js index ee0ba75482..c95b012aa9 100644 --- a/src/controllers/helpers.js +++ b/src/controllers/helpers.js @@ -26,7 +26,7 @@ helpers.noScriptErrors = function (req, res, error, httpStatus) { path: req.path, loggedIn: true, error: error, - returnLink: true, + returnLink: req.get('Referrer'), title: '[[global:' + httpStatusString + '.title]]', }); }); diff --git a/src/views/400.tpl b/src/views/400.tpl index c36f1b2f48..419f7beff5 100644 --- a/src/views/400.tpl +++ b/src/views/400.tpl @@ -7,6 +7,6 @@ -

[[error:goback]]

+ [[error:goback]] diff --git a/src/views/403.tpl b/src/views/403.tpl index bf93b496cd..16760c452c 100644 --- a/src/views/403.tpl +++ b/src/views/403.tpl @@ -7,7 +7,7 @@ -

[[error:goback]]

+ [[error:goback]] diff --git a/src/views/500-embed.tpl b/src/views/500-embed.tpl index b1045d431f..44bb1744ff 100644 --- a/src/views/500-embed.tpl +++ b/src/views/500-embed.tpl @@ -4,7 +4,7 @@ define('/assets/templates/500.jst', function () { return '
\n\t[[global:500.title]]\n\t

[[global:500.message]]

\n\t

' + helpers.__escape(get(context && context['path'])) + '

\n\t' + (get(context && context['error']) ? '

' + helpers.__escape(get(context && context['error'])) + '

' : '') + '\n\n\t' + - (get(context && context['returnLink']) ? '\n\t

[[error:goback]]

\n\t' : '') + '\n
\n'; + (get(context && context['returnLink']) ? '\n\t[[error:goback]]\n\t' : '') + '\n\n'; } return compiled; diff --git a/src/views/500.tpl b/src/views/500.tpl index 7795fbbf8a..fb611a23b8 100644 --- a/src/views/500.tpl +++ b/src/views/500.tpl @@ -5,6 +5,6 @@

{error}

-

[[error:goback]]

+ [[error:goback]]