Skip to content

Node.js based forum software built for the modern web

closes #2383

Barış Soner Uşaklı4d45a81fdb06
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index 865626635c..5e26619253 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -89,11 +89,9 @@ $(document).ready(function() {
app.previousUrl = url;
return ajaxify.go('login');
} else if (status === 302) {
- if (data.responseJSON.path) {
- if (!ajaxify.go(data.responseJSON.path, callback, quiet)) {
- window.location.href = data.responseJSON.path;
- }
- } else if (data.responseJSON) {
+ if (data.responseJSON.external && data.responseJSON.path) {
+ window.location.href = data.responseJSON.path;
+ } else if (typeof data.responseJSON === 'string') {
ajaxify.go(data.responseJSON.slice(1), callback, quiet);
}
}
@@ -184,6 +182,9 @@ $(document).ready(function() {
}
},
error: function(data, textStatus) {
+ if (data.status === 0 && textStatus === 'error') {
+ data.status = 500;
+ }
callback({
data: data,
textStatus: textStatus
@@ -264,5 +265,6 @@ $(document).ready(function() {
ajaxifyAnchors();
app.load();
+ templates.cache['500'] = $('.tpl-500').html();
});
\ No newline at end of file
diff --git a/src/views/500.tpl b/src/views/500.tpl
index 13b0e9de89..6408fbb79d 100644
--- a/src/views/500.tpl
+++ b/src/views/500.tpl
@@ -1,7 +1,7 @@
<div class="alert alert-danger">
<strong>[[global:500.title]]</strong>
<p>[[global:500.message]]</p>
- <p>{path}<p>
+ <p>{path}</p>
<!-- IF error --><p>{error}</p><!-- ENDIF error -->
-</div>
\ No newline at end of file
+</div>