diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index c5ed1af71..4d74435be 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -201,10 +201,10 @@ class HTMLDisplayHandler $output = preg_replace($pattern, '/?$1=', $output); } } - + // prevent the 2nd request due to url(none) of the background-image $output = preg_replace('/url\((["\']?)none(["\']?)\)/is', 'none', $output); - + if(is_array(Context::get('INPUT_ERROR'))) { $INPUT_ERROR = Context::get('INPUT_ERROR'); @@ -247,10 +247,16 @@ class HTMLDisplayHandler $this->_loadDesktopJSCSS(); } $output = $oTemplate->compile('./common/tpl', 'common_layout'); - + // 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); + } } /** diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 828d26b3c..e08278f92 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -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 . '' . PHP_EOL; + $contents = sprintf($sign, 'start') . $contents . sprintf($sign, 'end'); + } + return $contents; }