From 7bba7732d78f335a2f5e116354b35488832d6c36 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 9 Sep 2023 01:39:07 +0900 Subject: [PATCH] Display relative path in "Template not found" error message --- classes/template/TemplateHandler.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 97030c8fb..6d07297cd 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -149,7 +149,7 @@ class TemplateHandler { $tpl_path = rtrim(str_replace('\\', '/', $tpl_path), '/') . '/'; $error_message = vsprintf('Template not found: %s%s%s', array( - $tpl_path, + starts_with(\RX_BASEDIR, $tpl_path) ? substr($tpl_path, strlen(\RX_BASEDIR)) : $tpl_path, preg_replace('/\.html$/i', '', $tpl_filename) . '.html', $tpl_file ? " ($tpl_file)" : '', )); @@ -236,7 +236,7 @@ class TemplateHandler { $tpl_path = rtrim(str_replace('\\', '/', $tpl_path), '/') . '/'; $error_message = vsprintf('Template not found: %s%s', array( - $tpl_path, + starts_with(\RX_BASEDIR, $tpl_path) ? substr($tpl_path, strlen(\RX_BASEDIR)) : $tpl_path, preg_replace('/\.html$/i', '', $tpl_filename) . '.html', )); trigger_error($error_message, \E_USER_WARNING);