Don't clear PHP buffer when an error occurs with debug=true

This commit is contained in:
Grégoire Pineau
2019-06-06 16:16:15 +02:00
committed by Fabien Potencier
parent 2a293b6827
commit c910e71f5a
9 changed files with 86 additions and 9 deletions
+7 -1
View File
@@ -31,7 +31,13 @@ class SpacelessNode extends Node
{
$compiler
->addDebugInfo($this)
->write("ob_start(function () { return ''; });\n")
;
if ($compiler->getEnvironment()->isDebug()) {
$compiler->write("ob_start();\n");
} else {
$compiler->write("ob_start(function () { return ''; });\n");
}
$compiler
->subcompile($this->getNode('body'))
->write("echo trim(preg_replace('/>\s+</', '><', ob_get_clean()));\n")
;