Skip to content

Commit 903ede0

Browse files
author
vogelor
committed
Fixed a bug with the new template-handling in combination with the new error-handling
1 parent c9294bc commit 903ede0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

interface/lib/app.inc.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,20 @@ public function error($msg, $next_link = '', $stop = true, $priority = 1) {
123123
//$this->uses("error");
124124
//$this->error->message($msg, $priority);
125125
if($stop == true) {
126-
$content = file_get_contents(dirname(__FILE__) .
127-
'/../web/themes/' . $_SESSION['s']['theme'] . '/templates/error.tpl.htm');
126+
/*
127+
* We always have a error. So it is better not to use any more objects like
128+
* the template or so, because we don't know why the error occours (it could be, that
129+
* the error occours in one of these objects..)
130+
*/
131+
/*
132+
* Use the template inside the user-template - Path. If it is not found, fallback to the
133+
* default-template (the "normal" behaviour of all template - files)
134+
*/
135+
if (file_exists(dirname(__FILE__) . '/../web/themes/' . $_SESSION['s']['theme'] . '/templates/error.tpl.htm')) {
136+
$content = file_get_contents(dirname(__FILE__) . '/../web/themes/' . $_SESSION['s']['theme'] . '/templates/error.tpl.htm');
137+
} else {
138+
$content = file_get_contents(dirname(__FILE__) . '/../web/themes/default/templates/error.tpl.htm');
139+
}
128140
if($next_link != '') $msg .= '<a href="'.$next_link.'">Next</a>';
129141
$content = str_replace('###ERRORMSG###', $msg, $content);
130142
die($content);

0 commit comments

Comments
 (0)