From a00f3f5da6df270d38af3adc887a324b1a3e7212 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 14 Dec 2010 12:54:32 +0100 Subject: [PATCH] added an exception when trying to outdent too much --- lib/Twig/Compiler.php | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/lib/Twig/Compiler.php b/lib/Twig/Compiler.php index 72d791d..7eb90d0 100644 --- a/lib/Twig/Compiler.php +++ b/lib/Twig/Compiler.php @@ -218,6 +218,10 @@ class Twig_Compiler implements Twig_CompilerInterface { $this->indentation -= $step; + if ($this->indentation < 0) { + throw new Twig_Error('Unable to call outdent() as the indentation would become negative'); + } + return $this; } } -- 1.7.2.5