mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
디버그 기능 사용시 템플릿 경로를 표시하는 주석 태그 추가
관리자일 경우에만 표시 위젯 캐시 등 사용시 템플릿 주석이 노출될 가능성이 있으므로 HTMLDisplayHandler->prepareToPrint()에서 주석 제거 처리
This commit is contained in:
parent
afc0f26d6c
commit
913ccf4a3c
2 changed files with 17 additions and 3 deletions
|
|
@ -251,6 +251,12 @@ class HTMLDisplayHandler
|
|||
// replace the user-defined-language
|
||||
$oModuleController = getController('module');
|
||||
$oModuleController->replaceDefinedLangCode($output);
|
||||
|
||||
// remove comment tag
|
||||
if(Context::get('logged_info')->is_admin !== 'Y')
|
||||
{
|
||||
$output = preg_replace('/\n?<!--[^\[].*?-->/s', '', $output);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -357,6 +357,14 @@ class TemplateHandler
|
|||
{
|
||||
$contents .= ob_get_clean();
|
||||
}
|
||||
|
||||
// insert template path comment tag
|
||||
if(config('debug.enabled') && Context::get('logged_info')->is_admin === 'Y')
|
||||
{
|
||||
$sign = PHP_EOL . '<!-- Template %s : ' . $this->web_path . $this->filename . ' -->' . PHP_EOL;
|
||||
$contents = sprintf($sign, 'start') . $contents . sprintf($sign, 'end');
|
||||
}
|
||||
|
||||
return $contents;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue