mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-26 21:55:57 +00:00
Don't clear PHP buffer when an error occurs with debug=true
This commit is contained in:
committed by
Fabien Potencier
parent
2a293b6827
commit
c910e71f5a
@@ -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")
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user