From fead32337ea75e9a8c9d53f6840555929551b2b2 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 12 Sep 2023 22:42:30 +0900 Subject: [PATCH] Fix incorrect debug comment for outer templates in a deeply nested include tree --- classes/template/TemplateHandler.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 6d07297cd..122d5711c 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -452,6 +452,9 @@ class TemplateHandler */ private function _fetch($filename) { + // Remember the current template filename. + $__current_filename = $this->web_path . $this->filename; + // Import Context and lang as local variables. $__Context = Context::getAll(); $__Context->tpl_path = $this->path; @@ -474,8 +477,8 @@ class TemplateHandler // Insert template path comment tag. if(Rhymix\Framework\Debug::isEnabledForCurrentUser() && Context::getResponseMethod() === 'HTML' && !starts_with('web_path . $this->filename . ' -->' . "\n"; - $contents = sprintf($sign, 'start') . $contents . sprintf($sign, 'end'); + $sign = '' . "\n"; + $contents = sprintf($sign, 'Start') . $contents . sprintf($sign, 'End'); } return $contents;