From 39eb50c00e2c0b8174dbcd63e0ed45815ff7babf Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 14 Nov 2013 09:08:49 +0100 Subject: [PATCH] fixed optimizer max value --- CHANGELOG | 1 + lib/Twig/NodeVisitor/Optimizer.php | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b183fe8..4a9a8fd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ * 1.15.0 (2013-XX-XX) + * fixed a bug that prevented the optimizers to be enabled/disabled selectively * fixed first and last filters for UTF-8 strings * added a source function to include the content of a template without rendering it * fixed the C extension sandbox behavior when get or set is prepend to method name diff --git a/lib/Twig/NodeVisitor/Optimizer.php b/lib/Twig/NodeVisitor/Optimizer.php index da81ea3..5bf8eb0 100644 --- a/lib/Twig/NodeVisitor/Optimizer.php +++ b/lib/Twig/NodeVisitor/Optimizer.php @@ -39,7 +39,7 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface */ public function __construct($optimizers = -1) { - if (!is_int($optimizers) || $optimizers > 2) { + if (!is_int($optimizers) || $optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER | self::OPTIMIZE_VAR_ACCESS)) { throw new InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers)); } -- 1.7.2.5