BUGFIX: In SSViewer::parseTemplateContent($content, $template=""), when the $content is a xml template, we should not wrap anything around it, for web browser able to correct parse the xml

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@71923 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2009-02-17 01:24:46 +00:00 committed by Sam Minnee
parent 0e2345c253
commit d4a1087cb8

View File

@ -369,7 +369,7 @@ class SSViewer extends Object {
static function parseTemplateContent($content, $template="") {
// Add template filename comments on dev sites
if(Director::isDev() && self::$source_file_comments && $template) {
if(Director::isDev() && self::$source_file_comments && $template && stripos($content, "<?xml") === false) {
// If this template is a full HTML page, then put the comments just inside the HTML tag to prevent any IE glitches
if(stripos($content, "<html") !== false) {
$content = preg_replace('/(<html[^>]*>)/i', "\\1<!-- template $template -->", $content);