Fix #1790 duplicate .html extension in TemplateHandler error message

This commit is contained in:
Kijin Sung 2021-09-28 02:03:07 +09:00
parent 9b5ebb3a79
commit 454d2d85ff

View file

@ -144,7 +144,11 @@ class TemplateHandler
if(!$this->file || !file_exists($this->file))
{
$tpl_path = rtrim(str_replace('\\', '/', $tpl_path), '/') . '/';
$error_message = "Template not found: ${tpl_path}${tpl_filename}.html" . ($tpl_file ? " (${tpl_file})" : '');
$error_message = vsprintf('Template not found: %s%s%s', array(
$tpl_path,
preg_replace('/\.html$/i', '', $tpl_filename) . '.html',
$tpl_file ? " (${tpl_file})" : '',
));
trigger_error($error_message, \E_USER_WARNING);
return escape($error_message);
}
@ -213,7 +217,10 @@ class TemplateHandler
if(!$this->file || !file_exists($this->file))
{
$tpl_path = rtrim(str_replace('\\', '/', $tpl_path), '/') . '/';
$error_message = "Template not found: ${tpl_path}${tpl_filename}.html";
$error_message = vsprintf('Template not found: %s%s', array(
$tpl_path,
preg_replace('/\.html$/i', '', $tpl_filename) . '.html',
));
trigger_error($error_message, \E_USER_WARNING);
return escape($error_message);
}