From 87bb32679af1f666f203598178bb3dfff63287eb Mon Sep 17 00:00:00 2001 From: Steffen Kamper <info@sk-typo3.de> Date: Sun, 2 May 2010 14:15:53 +0000 Subject: [PATCH] Fixed bug #14279: Some non-XHTML tags in Backend (thanks to Steffen Gebert) git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7506 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 4 ++++ t3lib/class.t3lib_pagerenderer.php | 24 ++++++++++++++++++- .../sysext/cms/tslib/class.tslib_pagegen.php | 9 ++++--- typo3/template.php | 2 ++ 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c31a79bae30..59596358a86e 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-05-01 Steffen Kamper <info@sk-typo3.de> + + * Fixed bug #14279: Some non-XHTML tags in Backend (thanks to Steffen Gebert) + 2010-05-02 Sebastian Kurfuerst <sebastian@typo3.org> * Raised Extbase and Fluid versions to 1.2.0beta1. diff --git a/t3lib/class.t3lib_pagerenderer.php b/t3lib/class.t3lib_pagerenderer.php index a630f155cb83..b6ce14820e47 100644 --- a/t3lib/class.t3lib_pagerenderer.php +++ b/t3lib/class.t3lib_pagerenderer.php @@ -59,6 +59,8 @@ class t3lib_PageRenderer implements t3lib_Singleton { protected $favIcon; protected $baseUrl; + protected $renderXhtml = TRUE; + // static header blocks protected $xmlPrologAndDocType = ''; protected $metaTags = array (); @@ -183,6 +185,17 @@ class t3lib_PageRenderer implements t3lib_Singleton { $this->title = $title; } + + /** + * Enables/disables rendering of XHTML code + * + * @param boolean $enable Enable XHTML + * @return void + */ + public function setRenderXhtml($enable) { + $this->renderXhtml = $enable; + } + /** * Sets xml prolog and docType * @@ -384,6 +397,15 @@ class t3lib_PageRenderer implements t3lib_Singleton { return $this->lang; } + /** + * Returns rendering mode XHTML or HTML + * + * @return boolean TRUE if XHTML, FALSE if HTML + */ + public function getRenderXhtml() { + return $this->renderXhtml; + } + /** * Gets html tag * @@ -1001,7 +1023,7 @@ class t3lib_PageRenderer implements t3lib_Singleton { // remove ending slashes from static header block // if the page is beeing rendered as html (not xhtml) // and define variable $endingSlash for further use - if ($GLOBALS['TSFE']->xhtmlVersion) { + if ($this->getRenderXhtml()) { $endingSlash = ' /'; } else { $this->metaCharsetTag = str_replace(' />', '>', $this->metaCharsetTag); diff --git a/typo3/sysext/cms/tslib/class.tslib_pagegen.php b/typo3/sysext/cms/tslib/class.tslib_pagegen.php index b0dd7a43d5d1..a12022746082 100644 --- a/typo3/sysext/cms/tslib/class.tslib_pagegen.php +++ b/typo3/sysext/cms/tslib/class.tslib_pagegen.php @@ -244,9 +244,12 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t $GLOBALS['TSFE']->xhtmlVersion = 200; break; default: + $GLOBALS['TSFE']->getPageRenderer()->setRenderXhtml(FALSE); $GLOBALS['TSFE']->xhtmlDoctype = ''; $GLOBALS['TSFE']->xhtmlVersion = 0; } + } else { + $GLOBALS['TSFE']->getPageRenderer()->setRenderXhtml(FALSE); } } @@ -930,8 +933,8 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t } elseif ($GLOBALS['TSFE']->config['config']['removeDefaultJS'] === 'external') { /* This keeps inlineJS from *_INT Objects from being moved to external files. - At this point in frontend rendering *_INT Objects only have placeholders instead - of actual content so moving these placeholders to external files would + At this point in frontend rendering *_INT Objects only have placeholders instead + of actual content so moving these placeholders to external files would a) break the JS file (syntax errors due to the placeholders) b) the needed JS would never get included to the page Therefore inlineJS from *_INT Objects must not be moved to external files but @@ -1063,7 +1066,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t * Remember: Calls internally must still be done on the non-instantiated class: TSpagegen::inline2TempFile() * *************************/ - + /** * Searches for placeholder created from *_INT cObjects, removes them from * $searchString and merges them to $intObjects diff --git a/typo3/template.php b/typo3/template.php index 85eaeb6c0535..9aa78af556be 100644 --- a/typo3/template.php +++ b/typo3/template.php @@ -690,6 +690,8 @@ class template { case 'html_3': $headerStart = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'; $htmlTag = '<html>'; + // disable rendering of XHTML tags + $this->getPageRenderer()->setRenderXhtml(FALSE); break; case 'xhtml_strict': $headerStart = '<!DOCTYPE html -- GitLab