mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: moved includeDebuggingComments logic into own method to allow separated tests
This commit is contained in:
parent
7c66e8e7a2
commit
94b37f9c85
@ -4593,6 +4593,17 @@ class SSTemplateParser extends Parser {
|
||||
|
||||
// Include top level debugging comments if desired
|
||||
if($includeDebuggingComments && $templateName && stripos($code, "<?xml") === false) {
|
||||
$code = $parser->includeDebuggingComments($code, $templateName);
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
* @return string $code
|
||||
*/
|
||||
protected function includeDebuggingComments($code, $templateName) {
|
||||
// If this template contains a doctype, put it right after it,
|
||||
// if not, put it after the <html> tag to avoid IE glitches
|
||||
if(stripos($code, "<!doctype") !== false) {
|
||||
@ -4604,8 +4615,6 @@ class SSTemplateParser extends Parser {
|
||||
' -->\';' . "\r\n", $code);
|
||||
}
|
||||
$code .= "\r\n" . '$val .= \'<!-- end template ' . $templateName . ' -->\';';
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
|
@ -1047,6 +1047,17 @@ class SSTemplateParser extends Parser {
|
||||
|
||||
// Include top level debugging comments if desired
|
||||
if($includeDebuggingComments && $templateName && stripos($code, "<?xml") === false) {
|
||||
$code = $parser->includeDebuggingComments($code, $templateName);
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
* @return string $code
|
||||
*/
|
||||
protected function includeDebuggingComments($code, $templateName) {
|
||||
// If this template contains a doctype, put it right after it,
|
||||
// if not, put it after the <html> tag to avoid IE glitches
|
||||
if(stripos($code, "<!doctype") !== false) {
|
||||
@ -1058,8 +1069,6 @@ class SSTemplateParser extends Parser {
|
||||
' -->\';' . "\r\n", $code);
|
||||
}
|
||||
$code .= "\r\n" . '$val .= \'<!-- end template ' . $templateName . ' -->\';';
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user