- don't do $string[position] anymore, use substr() instead
- 'extends' was hanging loose there, rewrote it twice to fix parser error

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-05-17 18:37:51 +02:00
parent 0e0fb2b1ee
commit 98b407218d
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78
1 changed files with 3 additions and 3 deletions

View File

@ -652,14 +652,14 @@ function get_template_file($a, $filename, $root = '') {
$theme = current_theme();
// Make sure $root ends with a slash /
if ($root !== '' && $root[strlen($root) - 1] !== '/') {
if ($root !== '' && substr($root, -1, 1) !== '/') {
$root = $root . '/';
}
if (file_exists("{$root}view/theme/$theme/$filename")) {
$template_file = "{$root}view/theme/$theme/$filename";
} elseif (x($a->theme_info, "extends") && file_exists("{$root}view/theme/{$a->theme_info[\"extends\"]}/$filename")) {
$template_file = "{$root}view/theme/{$a->theme_info[\"extends\"]}/$filename";
} elseif (x($a->theme_info, "extends") && file_exists(sprintf('%sview/theme/%s}/%s', $root, $a->theme_info["extends"], $filename))) {
$template_file = sprintf('%sview/theme/%s}/%s', $root, $a->theme_info["extends"], $filename);
} elseif (file_exists("{$root}/$filename")) {
$template_file = "{$root}/$filename";
} else {