[BUGFIX] DocumentTemplate class inserts inDocStyles twice 50/27150/3
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 30 Jan 2014 13:59:55 +0000 (14:59 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 30 Jan 2014 18:18:37 +0000 (19:18 +0100)
Change-Id: I252da74973c3dc4157717139c95ad0605e16fce1
Releases: 6.2, 6.1, 4.5
Resolves: #55458
Reviewed-on: https://review.typo3.org/27150
Reviewed-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/template.php

index d415583..538fac2 100644 (file)
@@ -1149,6 +1149,11 @@ $str.=$this->docBodyTagBegin().
                        // Implode it all:
                $inDocStyles = implode(LF, $this->inDocStylesArray);
 
+               // Reset styles so they won't be added again in insertStylesAndJS()
+               $this->inDocStylesArray = array();
+               $this->inDocStyles = '';
+               $this->inDocStyles_TBEstyle = '';
+
                if ($this->styleSheetFile) {
                        $this->pageRenderer->addCssFile($this->backPath . $this->styleSheetFile);
                }
@@ -1209,7 +1214,9 @@ $str.=$this->docBodyTagBegin().
         */
        function insertStylesAndJS($content)    {
                        // insert accumulated CSS
-               $this->inDocStylesArray[] = $this->inDocStyles;
+               if (!empty($this->inDocStyles)) {
+                       $this->inDocStylesArray[] = $this->inDocStyles;
+               }
                $styles = LF.implode(LF, $this->inDocStylesArray);
                $content = str_replace('/*###POSTCSSMARKER###*/',$styles,$content);