From: Fabien Potencier Date: Tue, 14 Dec 2010 11:54:32 +0000 (+0100) Subject: added an exception when trying to outdent too much X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=a00f3f5da6df270d38af3adc887a324b1a3e7212;p=web%2Fkonrad%2Ftwig.git added an exception when trying to outdent too much --- 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; } }