fixed optimizer max value

This commit is contained in:
Fabien Potencier
2013-11-14 09:08:49 +01:00
parent 2d012c4a4a
commit 39eb50c00e
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -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
+1 -1
View File
@@ -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));
}