Merge branch '1.x' into 2.x

* 1.x:
  Don't clear PHP buffer when an error occurs with debug=true
  Remove duplicate phpdoc
This commit is contained in:
Fabien Potencier
2019-06-10 19:37:27 +02:00
9 changed files with 86 additions and 9 deletions
+7 -1
View File
@@ -33,7 +33,13 @@ class SpacelessNode extends Node implements NodeOutputInterface
{
$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")
;