[BUGFIX] DebuggerUtility should return css when requested. 47/45147/2
authorBenni Mack <benni@typo3.org>
Sat, 5 Dec 2015 15:12:16 +0000 (16:12 +0100)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 6 Dec 2015 19:36:09 +0000 (20:36 +0100)
The DebuggerUtility of Extbase should only echo the CSS when
the debug info is echoed as well, otherwise it should be
returned just like the option describes it.

Resolves: #60893
Releases: master
Change-Id: I7196df201cb5974308aaf103aac5d63e63c02e61
Reviewed-on: https://review.typo3.org/45147
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/extbase/Classes/Utility/DebuggerUtility.php

index 2d317d2..bee8160 100644 (file)
@@ -416,8 +416,9 @@ class DebuggerUtility
             self::$blacklistedPropertyNames = $blacklistedPropertyNames;
         }
         self::clearState();
             self::$blacklistedPropertyNames = $blacklistedPropertyNames;
         }
         self::clearState();
+        $css = '';
         if (!$plainText && self::$stylesheetEchoed === false) {
         if (!$plainText && self::$stylesheetEchoed === false) {
-            echo '
+            $css = '
                                <style type=\'text/css\'>
                                        .extbase-debugger-tree{position:relative}
                                        .extbase-debugger-tree input{position:absolute;top:0;left:0;height:14px;width:14px;margin:0;cursor:pointer;opacity:0;z-index:2}
                                <style type=\'text/css\'>
                                        .extbase-debugger-tree{position:relative}
                                        .extbase-debugger-tree input{position:absolute;top:0;left:0;height:14px;width:14px;margin:0;cursor:pointer;opacity:0;z-index:2}
@@ -457,9 +458,9 @@ class DebuggerUtility
                        ';
         }
         if ($return === true) {
                        ';
         }
         if ($return === true) {
-            return $output;
+            return $css . $output;
         } else {
         } else {
-            echo $output;
+            echo $css . $output;
         }
         return '';
     }
         }
         return '';
     }