Bug #60893
closedIE quirks mode by <f:debug inline="true"> and \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump (solution included)
100%
Description
<f:debug inline="true"> or DebuggerUtility::var_dump(...$return = 1) output the css above the <DOCTYPE> and thereby set the IE to quirks mode.
Of course in production this has to be disabled, but there are many cases you want to test in IE with inline <f:debug> or even have some extension that has a DebuggerUtility::var_dump at some place with a $return = 1.
The best solution we find is to also return the $css if you want to put the debugging inline. As researched all browsers accept the <style> tag within the <body> but will have much bigger problems when having the <style> tage before the <Doctype>.
This is the proposed solution which does not influence the regular use with $return=false, which means regular echo...
if (!$plainText && self::$stylesheetEchoed === FALSE) { $css = ' <style type=\'text/css\'> ... </style>'; self::$stylesheetEchoed = TRUE; } if ($plainText) { $output = $title . PHP_EOL . self::renderDump($variable, 0, TRUE, $ansiColors) . PHP_EOL . PHP_EOL; } else { $output = ' <div class="Extbase-Utility-Debugger-VarDump ' . ($return ? 'Extbase-Utility-Debugger-VarDump-Inline' : 'Extbase-Utility-Debugger-VarDump-Floating') . '"> <div class="Extbase-Utility-Debugger-VarDump-Top">' . htmlspecialchars($title) . '</div> <div class="Extbase-Utility-Debugger-VarDump-Center"> <pre dir="ltr">' . self::renderDump($variable, 0, FALSE, FALSE) . '</pre> </div> </div> '; } if ($return === TRUE) { $output = $css . $output; return $output; } else { echo $css; echo $output; }
Updated by Alexander Opitz about 10 years ago
- Project changed from 534 to TYPO3 Core
- Category changed from Extbase: Utility to Extbase
- TYPO3 Version set to 6.2
- Is Regression set to No
Updated by Riccardo De Contardi almost 9 years ago
- Target version set to Candidate for patchlevel
still true for 7.6.1 (latest master)
Updated by Gerrit Code Review almost 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45147
Updated by Benni Mack almost 9 years ago
- Assignee set to Benni Mack
- Target version changed from Candidate for patchlevel to next-patchlevel
Updated by Benni Mack almost 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 80 to 100
Applied in changeset 456d50575bdec0ec6d015785ef7105d804286513.