mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
fix nested buffers issue #374
This commit is contained in:
Regular → Executable
+2
-5
@@ -192,15 +192,12 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|||||||
*/
|
*/
|
||||||
public function render(array $context)
|
public function render(array $context)
|
||||||
{
|
{
|
||||||
|
$level = ob_get_level();
|
||||||
ob_start();
|
ob_start();
|
||||||
try {
|
try {
|
||||||
$this->display($context);
|
$this->display($context);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
// the count variable avoids an infinite loop on
|
while (ob_get_level() > $level) {
|
||||||
// some Windows configurations where ob_get_level()
|
|
||||||
// never reaches 0
|
|
||||||
$count = 100;
|
|
||||||
while (ob_get_level() && --$count) {
|
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user