Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1937)
+++ branches/2.8.x/CHANGELOG	(revision 1938)
@@ -11,6 +11,8 @@
 ! = Update/Change
 ===============================================================================
 
+25 Jul-2013 Build 1938 M.v.d.Decken(DarkViper)
+! update Twig template engine to version 1.13.1
 25 Jul-2013 Build 1937 M.v.d.Decken(DarkViper)
 - unneeded file /framework/Modlanguage.php removed
 24 Jul-2013 Build 1936 M.v.d.Decken(DarkViper)
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/IntegrationTestCase.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/IntegrationTestCase.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/IntegrationTestCase.php	(revision 1938)
@@ -12,9 +12,8 @@
 /**
  * Integration test helper
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- * @author  Karma Dordrak <drak@zikula.org>
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Karma Dordrak <drak@zikula.org>
  */
 abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Method.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Method.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Method.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a method template test.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Test_Method extends Twig_Test
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Function.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Function.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Function.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a function template test.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Test_Function extends Twig_Test
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Node.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Node.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test/Node.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a template test as a Node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Test_Node extends Twig_Test
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Parser.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Parser.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Parser.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Default parser implementation.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Parser implements Twig_ParserInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExtensionInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExtensionInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExtensionInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Interface implemented by extension classes.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 interface Twig_ExtensionInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Base class for all token parsers.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 abstract class Twig_TokenParser implements Twig_TokenParserInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/AutoEscape.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/AutoEscape.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/AutoEscape.php	(revision 1938)
@@ -18,8 +18,7 @@
  *
  * If autoescaping is disabled, then the value is false.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_AutoEscape extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Block.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Block.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Block.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a block node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Block extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Set.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Set.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Set.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a set node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Set extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Print.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Print.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Print.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a node that outputs an expression.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Print extends Twig_Node implements Twig_NodeOutputInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Body.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Body.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Body.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a body node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Body extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Sandbox.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Sandbox.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Sandbox.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a sandbox node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Sandbox extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/If.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/If.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/If.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents an if node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_If extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Abstract class for all nodes that represents an expression.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 abstract class Twig_Node_Expression extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Macro.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Macro.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Macro.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a macro node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Macro extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Do.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Do.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Do.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a do node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Do extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/BlockReference.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/BlockReference.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/BlockReference.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a block call node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_BlockReference extends Twig_Node implements Twig_NodeOutputInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Constant.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Constant.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Constant.php	(revision 1938)
@@ -18,8 +18,7 @@
  *  {% endif %}
  * </pre>
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Test_Constant extends Twig_Node_Expression_Test
 {
@@ -29,6 +28,17 @@
             ->raw('(')
             ->subcompile($this->getNode('node'))
             ->raw(' === constant(')
+        ;
+
+        if ($this->getNode('arguments')->hasNode(1)) {
+            $compiler
+                ->raw('get_class(')
+                ->subcompile($this->getNode('arguments')->getNode(1))
+                ->raw(')."::".')
+            ;
+        }
+
+        $compiler
             ->subcompile($this->getNode('arguments')->getNode(0))
             ->raw('))')
         ;
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Sameas.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Sameas.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Sameas.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Checks if a variable is the same as another one (=== in PHP).
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Test_Sameas extends Twig_Node_Expression_Test
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Null.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Null.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Null.php	(revision 1938)
@@ -16,8 +16,7 @@
  *  {{ var is none }}
  * </pre>
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Test_Null extends Twig_Node_Expression_Test
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Even.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Even.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Even.php	(revision 1938)
@@ -16,8 +16,7 @@
  *  {{ var is even }}
  * </pre>
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Test_Even extends Twig_Node_Expression_Test
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Defined.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Defined.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Defined.php	(revision 1938)
@@ -19,8 +19,7 @@
  * {% endif %}
  * </pre>
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Test_Defined extends Twig_Node_Expression_Test
 {
@@ -35,7 +34,7 @@
 
             $this->changeIgnoreStrictCheck($node);
         } else {
-            throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine(), $compiler->getFilename());
+            throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine());
         }
     }
 
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Divisibleby.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Divisibleby.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Divisibleby.php	(revision 1938)
@@ -16,8 +16,7 @@
  *  {% if loop.index is divisibleby(3) %}
  * </pre>
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Test_Divisibleby extends Twig_Node_Expression_Test
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Odd.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Odd.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Test/Odd.php	(revision 1938)
@@ -16,8 +16,7 @@
  *  {{ var is odd }}
  * </pre>
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Test_Odd extends Twig_Node_Expression_Test
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Parent.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Parent.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Parent.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a parent node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Parent extends Twig_Node_Expression
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/ExtensionReference.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/ExtensionReference.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/ExtensionReference.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents an extension call node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_ExtensionReference extends Twig_Node_Expression
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Filter/Default.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Filter/Default.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Filter/Default.php	(revision 1938)
@@ -16,8 +16,7 @@
  *  {{ var.foo|default('foo item on var is not defined') }}
  * </pre>
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_Filter_Default extends Twig_Node_Expression_Filter
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/BlockReference.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/BlockReference.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/BlockReference.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a block call node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Expression_BlockReference extends Twig_Node_Expression
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Call.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Call.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Call.php	(revision 1938)
@@ -98,7 +98,10 @@
             if (!is_int($name)) {
                 $named = true;
                 $name = $this->normalizeName($name);
+            } elseif ($named) {
+                throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $this->getAttribute('type'), $this->getAttribute('name')));
             }
+
             $parameters[$name] = $node;
         }
 
@@ -142,6 +145,10 @@
             $name = $this->normalizeName($param->name);
 
             if (array_key_exists($name, $parameters)) {
+                if (array_key_exists($pos, $parameters)) {
+                    throw new Twig_Error_Syntax(sprintf('Arguments "%s" is defined twice for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name')));
+                }
+
                 $arguments[] = $parameters[$name];
                 unset($parameters[$name]);
             } elseif (array_key_exists($pos, $parameters)) {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Import.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Import.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Import.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents an import node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Import extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Embed.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Embed.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Embed.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents an embed node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Embed extends Twig_Node_Include
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/SandboxedModule.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/SandboxedModule.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/SandboxedModule.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a module node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_SandboxedModule extends Twig_Node_Module
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/ForLoop.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/ForLoop.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/ForLoop.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Internal node used by the for node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_ForLoop extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Flush.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Flush.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Flush.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a flush node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Flush extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Spaceless.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Spaceless.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Spaceless.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * It removes spaces between HTML tags.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Spaceless extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Include.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Include.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Include.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents an include node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/SandboxedPrint.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/SandboxedPrint.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/SandboxedPrint.php	(revision 1938)
@@ -17,8 +17,7 @@
  * and if the sandbox is enabled, we need to check that the __toString()
  * method is allowed if 'article' is an object.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_SandboxedPrint extends Twig_Node_Print
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Text.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Text.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Text.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a text node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Text extends Twig_Node implements Twig_NodeOutputInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Module.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Module.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Module.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a module node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_Module extends Twig_Node
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/For.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/For.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/For.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a for node.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node_For extends Twig_Node
 {
@@ -108,6 +107,6 @@
         $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n");
 
         // keep the values set in the inner context for variables defined in the outer context
-        $compiler->write("\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));\n");
+        $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n");
     }
 }
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Method.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Method.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Method.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFilter instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Filter_Method extends Twig_Filter
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Function.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Function.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Function.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFilter instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Filter_Function extends Twig_Filter
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Node.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Node.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter/Node.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFilter instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Filter_Node extends Twig_Filter
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleFunction.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleFunction.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleFunction.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a template function.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_SimpleFunction
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/LexerInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/LexerInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/LexerInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Interface implemented by lexer classes.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_LexerInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TestInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TestInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TestInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a template test.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_TestInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a node in the AST.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_NodeInterface extends Countable, IteratorAggregate
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FilterInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FilterInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FilterInterface.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFilter instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_FilterInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Set.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Set.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Set.php	(revision 1938)
@@ -49,7 +49,7 @@
             $stream->expect(Twig_Token::BLOCK_END_TYPE);
 
             if (count($names) !== count($values)) {
-                throw new Twig_Error_Syntax("When using set, you must have the same number of variables and assignements.", $stream->getCurrent()->getLine(), $stream->getFilename());
+                throw new Twig_Error_Syntax("When using set, you must have the same number of variables and assignments.", $stream->getCurrent()->getLine(), $stream->getFilename());
             }
         } else {
             $capture = true;
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Use.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Use.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Use.php	(revision 1938)
@@ -68,8 +68,6 @@
         $stream->expect(Twig_Token::BLOCK_END_TYPE);
 
         $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets))));
-
-        return null;
     }
 
     /**
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Macro.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Macro.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Macro.php	(revision 1938)
@@ -49,8 +49,6 @@
         $stream->expect(Twig_Token::BLOCK_END_TYPE);
 
         $this->parser->setMacro($name, new Twig_Node_Macro($name, new Twig_Node_Body(array($body)), $arguments, $lineno, $this->getTag()));
-
-        return null;
     }
 
     public function decideBlockEnd(Twig_Token $token)
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Do.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Do.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Do.php	(revision 1938)
@@ -10,7 +10,7 @@
  */
 
 /**
- * Evaluates an expression, disgarding the returned value.
+ * Evaluates an expression, discarding the returned value.
  */
 class Twig_TokenParser_Do extends Twig_TokenParser
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Extends.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Extends.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParser/Extends.php	(revision 1938)
@@ -38,8 +38,6 @@
         $this->parser->setParent($this->parser->getExpressionParser()->parseExpression());
 
         $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return null;
     }
 
     /**
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityError.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityError.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityError.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Exception thrown when a security error occurs at runtime.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Sandbox_SecurityError extends Twig_Error
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityPolicy.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityPolicy.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityPolicy.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a security policy which need to be enforced when sandbox mode is enabled.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Sandbox_SecurityPolicy implements Twig_Sandbox_SecurityPolicyInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityPolicyInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityPolicyInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Sandbox/SecurityPolicyInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Interfaces that all security policy classes must implements.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 interface Twig_Sandbox_SecurityPolicyInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Template.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Template.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Template.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Default base class for compiled templates.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 abstract class Twig_Template implements Twig_TemplateInterface
 {
@@ -337,21 +336,21 @@
      */
     protected function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
     {
-        $item = ctype_digit((string) $item) ? (int) $item : (string) $item;
-
         // array
         if (Twig_TemplateInterface::METHOD_CALL !== $type) {
-            if ((is_array($object) && array_key_exists($item, $object))
-                || ($object instanceof ArrayAccess && isset($object[$item]))
+            $arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item;
+
+            if ((is_array($object) && array_key_exists($arrayItem, $object))
+                || ($object instanceof ArrayAccess && isset($object[$arrayItem]))
             ) {
                 if ($isDefinedTest) {
                     return true;
                 }
 
-                return $object[$item];
+                return $object[$arrayItem];
             }
 
-            if (Twig_TemplateInterface::ARRAY_CALL === $type) {
+            if (Twig_TemplateInterface::ARRAY_CALL === $type || !is_object($object)) {
                 if ($isDefinedTest) {
                     return false;
                 }
@@ -361,11 +360,13 @@
                 }
 
                 if (is_object($object)) {
-                    throw new Twig_Error_Runtime(sprintf('Key "%s" in object (with ArrayAccess) of type "%s" does not exist', $item, get_class($object)), -1, $this->getTemplateName());
+                    throw new Twig_Error_Runtime(sprintf('Key "%s" in object (with ArrayAccess) of type "%s" does not exist', $arrayItem, get_class($object)), -1, $this->getTemplateName());
                 } elseif (is_array($object)) {
-                    throw new Twig_Error_Runtime(sprintf('Key "%s" for array with keys "%s" does not exist', $item, implode(', ', array_keys($object))), -1, $this->getTemplateName());
+                    throw new Twig_Error_Runtime(sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))), -1, $this->getTemplateName());
+                } elseif (Twig_TemplateInterface::ARRAY_CALL === $type) {
+                    throw new Twig_Error_Runtime(sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName());
                 } else {
-                    throw new Twig_Error_Runtime(sprintf('Impossible to access a key ("%s") on a "%s" variable', $item, gettype($object)), -1, $this->getTemplateName());
+                    throw new Twig_Error_Runtime(sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName());
                 }
             }
         }
@@ -379,7 +380,7 @@
                 return null;
             }
 
-            throw new Twig_Error_Runtime(sprintf('Item "%s" for "%s" does not exist', $item, is_array($object) ? 'Array' : $object), -1, $this->getTemplateName());
+            throw new Twig_Error_Runtime(sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName());
         }
 
         $class = get_class($object);
@@ -386,7 +387,7 @@
 
         // object property
         if (Twig_TemplateInterface::METHOD_CALL !== $type) {
-            if (isset($object->$item) || array_key_exists($item, $object)) {
+            if (isset($object->$item) || array_key_exists((string) $item, $object)) {
                 if ($isDefinedTest) {
                     return true;
                 }
@@ -406,13 +407,13 @@
 
         $lcItem = strtolower($item);
         if (isset(self::$cache[$class]['methods'][$lcItem])) {
-            $method = $item;
+            $method = (string) $item;
         } elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) {
             $method = 'get'.$item;
         } elseif (isset(self::$cache[$class]['methods']['is'.$lcItem])) {
             $method = 'is'.$item;
         } elseif (isset(self::$cache[$class]['methods']['__call'])) {
-            $method = $item;
+            $method = (string) $item;
         } else {
             if ($isDefinedTest) {
                 return false;
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Interface implemented by token parsers.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 interface Twig_TokenParserInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Sandbox.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Sandbox.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Sandbox.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Twig_NodeVisitor_Sandbox implements sandboxing.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_NodeVisitor_Sandbox implements Twig_NodeVisitorInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Escaper.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Escaper.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Escaper.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Twig_NodeVisitor_Escaper implements output escaping.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Optimizer.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Optimizer.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/Optimizer.php	(revision 1938)
@@ -17,8 +17,7 @@
  * You can configure which optimizations you want to activate via the
  * optimizer mode.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/SafeAnalysis.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/SafeAnalysis.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitor/SafeAnalysis.php	(revision 1938)
@@ -20,8 +20,6 @@
                 }
             }
         }
-
-        return null;
     }
 
     protected function setSafe(Twig_NodeInterface $node, array $safe)
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TestCallableInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TestCallableInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TestCallableInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a callable template test.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_TestCallableInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Array.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Array.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Array.php	(revision 1938)
@@ -17,8 +17,7 @@
  * source code of the template). If you don't want to see your cache grows out of
  * control, you need to take care of clearing the old cache file by yourself.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Chain.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Chain.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Chain.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Loads templates from other loaders.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
 {
@@ -77,8 +76,12 @@
         }
 
         foreach ($this->loaders as $loader) {
-            if ($loader instanceof Twig_ExistsLoaderInterface && $loader->exists($name)) {
-                return $this->hasSourceCache[$name] = true;
+            if ($loader instanceof Twig_ExistsLoaderInterface) {
+                if ($loader->exists($name)) {
+                    return $this->hasSourceCache[$name] = true;
+                }
+
+                continue;
             }
 
             try {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Filesystem.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Filesystem.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Filesystem.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Loads template from the filesystem.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
 {
@@ -25,9 +24,11 @@
      *
      * @param string|array $paths A path or an array of paths where to look for templates
      */
-    public function __construct($paths)
+    public function __construct($paths = array())
     {
-        $this->setPaths($paths);
+        if ($paths) {
+            $this->setPaths($paths);
+        }
     }
 
     /**
@@ -204,6 +205,7 @@
             throw new Twig_Error_Loader('A template name cannot contain NUL bytes.');
         }
 
+        $name = ltrim($name, '/');
         $parts = explode('/', $name);
         $level = 0;
         foreach ($parts as $part) {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/String.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/String.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/String.php	(revision 1938)
@@ -21,8 +21,7 @@
  * source code of the template). If you don't want to see your cache grows out of
  * control, you need to take care of clearing the old cache file by yourself.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserBrokerInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserBrokerInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserBrokerInterface.php	(revision 1938)
@@ -15,8 +15,7 @@
  *
  * Token parser brokers allows to implement custom logic in the process of resolving a token parser for a given tag name.
  *
- * @package    twig
- * @author     Arnaud Le Blanc <arnaud.lb@gmail.com>
+ * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_TokenParserBrokerInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeTraverser.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeTraverser.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeTraverser.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * It visits all nodes and their children and call the given visitor for each.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_NodeTraverser
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFunction instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 abstract class Twig_Function implements Twig_FunctionInterface, Twig_FunctionCallableInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FilterCallableInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FilterCallableInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FilterCallableInterface.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFilter instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_FilterCallableInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Staging.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Staging.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Staging.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * This class is used by Twig_Environment as a staging area and must not be used directly.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Extension_Staging extends Twig_Extension
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/StringLoader.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/StringLoader.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/StringLoader.php	(revision 1938)
@@ -33,7 +33,7 @@
  * Loads a template from a string.
  *
  * <pre>
- * {% include template_from_string("Hello {{ name }}") }}
+ * {{ include(template_from_string("Hello {{ name }}")) }}
  * </pre>
  *
  * @param Twig_Environment $env      A Twig_Environment instance
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Debug.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Debug.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Debug.php	(revision 1938)
@@ -24,6 +24,7 @@
             // false means that it was not set (and the default is on) or it explicitly enabled
             // xdebug.overload_var_dump produces HTML only when html_errors is also enabled
             && (false === ini_get('html_errors') || ini_get('html_errors'))
+            || 'cli' === php_sapi_name()
         ;
 
         return array(
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Core.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Core.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Extension/Core.php	(revision 1938)
@@ -152,6 +152,7 @@
             new Twig_SimpleFilter('split', 'twig_split_filter'),
             new Twig_SimpleFilter('sort', 'twig_sort_filter'),
             new Twig_SimpleFilter('merge', 'twig_array_merge'),
+            new Twig_SimpleFilter('batch', 'twig_array_batch'),
 
             // string/array filters
             new Twig_SimpleFilter('reverse', 'twig_reverse_filter', array('needs_environment' => true)),
@@ -170,8 +171,8 @@
         );
 
         if (function_exists('mb_get_info')) {
-            $filters['upper'] = new Twig_Filter_Function('twig_upper_filter', array('needs_environment' => true));
-            $filters['lower'] = new Twig_Filter_Function('twig_lower_filter', array('needs_environment' => true));
+            $filters[] = new Twig_SimpleFilter('upper', 'twig_upper_filter', array('needs_environment' => true));
+            $filters[] = new Twig_SimpleFilter('lower', 'twig_lower_filter', array('needs_environment' => true));
         }
 
         return $filters;
@@ -190,7 +191,7 @@
             new Twig_SimpleFunction('cycle', 'twig_cycle'),
             new Twig_SimpleFunction('random', 'twig_random', array('needs_environment' => true)),
             new Twig_SimpleFunction('date', 'twig_date_converter', array('needs_environment' => true)),
-            new Twig_SimpleFunction('include', 'twig_include', array('needs_environment' => true, 'needs_context' => true)),
+            new Twig_SimpleFunction('include', 'twig_include', array('needs_environment' => true, 'needs_context' => true, 'is_safe' => array('all'))),
         );
     }
 
@@ -514,15 +515,19 @@
 }
 
 /**
- * URL encodes a string.
+ * URL encodes a string as a path segment or an array as a query string.
  *
- * @param string $url A URL
- * @param bool   $raw true to use rawurlencode() instead of urlencode
+ * @param string|array $url A URL or an array of query parameters
+ * @param bool         $raw true to use rawurlencode() instead of urlencode
  *
  * @return string The URL encoded value
  */
 function twig_urlencode_filter($url, $raw = false)
 {
+    if (is_array($url)) {
+        return http_build_query($url, '', '&');
+    }
+
     if ($raw) {
         return rawurlencode($url);
     }
@@ -842,12 +847,16 @@
  */
 function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false)
 {
-    if ($autoescape && is_object($string) && $string instanceof Twig_Markup) {
+    if ($autoescape && $string instanceof Twig_Markup) {
         return $string;
     }
 
-    if (!is_string($string) && !(is_object($string) && method_exists($string, '__toString'))) {
-        return $string;
+    if (!is_string($string)) {
+        if (is_object($string) && method_exists($string, '__toString')) {
+            $string = (string) $string;
+        } else {
+            return $string;
+        }
     }
 
     if (null === $charset) {
@@ -854,9 +863,46 @@
         $charset = $env->getCharset();
     }
 
-    $string = (string) $string;
+    switch ($strategy) {
+        case 'html':
+            // see http://php.net/htmlspecialchars
 
-    switch ($strategy) {
+            // Using a static variable to avoid initializing the array
+            // each time the function is called. Moving the declaration on the
+            // top of the function slow downs other escaping strategies.
+            static $htmlspecialcharsCharsets = array(
+                'ISO-8859-1' => true, 'ISO8859-1' => true,
+                'ISO-8859-15' => true, 'ISO8859-15' => true,
+                'utf-8' => true, 'UTF-8' => true,
+                'CP866' => true, 'IBM866' => true, '866' => true,
+                'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true,
+                '1251' => true,
+                'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true,
+                'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true,
+                'BIG5' => true, '950' => true,
+                'GB2312' => true, '936' => true,
+                'BIG5-HKSCS' => true,
+                'SHIFT_JIS' => true, 'SJIS' => true, '932' => true,
+                'EUC-JP' => true, 'EUCJP' => true,
+                'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true,
+            );
+
+            if (isset($htmlspecialcharsCharsets[$charset])) {
+                return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
+            }
+
+            if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) {
+                // cache the lowercase variant for future iterations
+                $htmlspecialcharsCharsets[$charset] = true;
+
+                return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
+            }
+
+            $string = twig_convert_encoding($string, 'UTF-8', $charset);
+            $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
+
+            return twig_convert_encoding($string, $charset, 'UTF-8');
+
         case 'js':
             // escape all non-alphanumeric characters
             // into their \xHH or \uHHHH representations
@@ -910,40 +956,10 @@
 
             return $string;
 
-        case 'html':
-            // see http://php.net/htmlspecialchars
-
-            // Using a static variable to avoid initializing the array
-            // each time the function is called. Moving the declaration on the
-            // top of the function slow downs other escaping strategies.
-            static $htmlspecialcharsCharsets = array(
-                'iso-8859-1' => true, 'iso8859-1' => true,
-                'iso-8859-15' => true, 'iso8859-15' => true,
-                'utf-8' => true,
-                'cp866' => true, 'ibm866' => true, '866' => true,
-                'cp1251' => true, 'windows-1251' => true, 'win-1251' => true,
-                '1251' => true,
-                'cp1252' => true, 'windows-1252' => true, '1252' => true,
-                'koi8-r' => true, 'koi8-ru' => true, 'koi8r' => true,
-                'big5' => true, '950' => true,
-                'gb2312' => true, '936' => true,
-                'big5-hkscs' => true,
-                'shift_jis' => true, 'sjis' => true, '932' => true,
-                'euc-jp' => true, 'eucjp' => true,
-                'iso8859-5' => true, 'iso-8859-5' => true, 'macroman' => true,
-            );
-
-            if (isset($htmlspecialcharsCharsets[strtolower($charset)])) {
-                return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
-            }
-
-            $string = twig_convert_encoding($string, 'UTF-8', $charset);
-            $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
-
-            return twig_convert_encoding($string, $charset, 'UTF-8');
-
         case 'url':
-            if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+            // hackish test to avoid version_compare that is much slower, this works unless PHP releases a 5.10.*
+            // at that point however PHP 5.2.* support can be removed
+            if (PHP_VERSION < '5.3.0') {
                 return str_replace('%7E', '~', rawurlencode($string));
             }
 
@@ -1257,11 +1273,11 @@
 /**
  * Renders a template.
  *
- * @param string  template       The template to render
- * @param array   variables      The variables to pass to the template
- * @param Boolean with_context   Whether to pass the current context variables or not
- * @param Boolean ignore_missing Whether to ignore missing templates or not
- * @param Boolean sandboxed      Whether to sandbox the template or not
+ * @param string  $template       The template to render
+ * @param array   $variables      The variables to pass to the template
+ * @param Boolean $with_context   Whether to pass the current context variables or not
+ * @param Boolean $ignore_missing Whether to ignore missing templates or not
+ * @param Boolean $sandboxed      Whether to sandbox the template or not
  *
  * @return string The rendered template
  */
@@ -1279,7 +1295,7 @@
     }
 
     try {
-        return $env->resolveTemplate($template)->display($variables);
+        return $env->resolveTemplate($template)->render($variables);
     } catch (Twig_Error_Loader $e) {
         if (!$ignoreMissing) {
             throw $e;
@@ -1307,3 +1323,33 @@
 
     return constant($constant);
 }
+
+/**
+ * Batches item.
+ *
+ * @param array   $items An array of items
+ * @param integer $size  The size of the batch
+ * @param string  $fill  A string to fill missing items
+ *
+ * @return array
+ */
+function twig_array_batch($items, $size, $fill = null)
+{
+    if ($items instanceof Traversable) {
+        $items = iterator_to_array($items, false);
+    }
+
+    $size = ceil($size);
+
+    $result = array_chunk($items, $size, true);
+
+    if (null !== $fill) {
+        $last = count($result) - 1;
+        $result[$last] = array_merge(
+            $result[$last],
+            array_fill(0, $size - count($result[$last]), $fill)
+        );
+    }
+
+    return $result;
+}
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitorInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitorInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeVisitorInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Twig_NodeVisitorInterface is the interface the all node visitor classes must implement.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 interface Twig_NodeVisitorInterface
 {
@@ -33,7 +32,7 @@
      * @param Twig_NodeInterface $node The node to visit
      * @param Twig_Environment   $env  The Twig environment instance
      *
-     * @return Twig_NodeInterface The modified node
+     * @return Twig_NodeInterface|false The modified node or false if the node must be removed
      */
     public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env);
 
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleTest.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleTest.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleTest.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a template test.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_SimpleTest
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error.php	(revision 1938)
@@ -29,8 +29,7 @@
  * can be disabled by passing false for both the filename and the line number
  * when creating a new instance of this class.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Error extends Exception
 {
@@ -187,7 +186,14 @@
     protected function guessTemplateInfo()
     {
         $template = null;
-        foreach (debug_backtrace() as $trace) {
+
+        if (version_compare(phpversion(), '5.3.6', '>=')) {
+            $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);
+        } else {
+            $backtrace = debug_backtrace();
+        }
+
+        foreach ($backtrace as $trace) {
             if (isset($trace['object']) && $trace['object'] instanceof Twig_Template && 'Twig_Template' !== get_class($trace['object'])) {
                 if (null === $this->filename || $this->filename == $trace['object']->getTemplateName()) {
                     $template = $trace['object'];
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/CompilerInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/CompilerInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/CompilerInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Interface implemented by compiler classes.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_CompilerInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenStream.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenStream.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenStream.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a token stream.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_TokenStream
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TemplateInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TemplateInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TemplateInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Interface implemented by all compiled templates.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_TemplateInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Autoloader.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Autoloader.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Autoloader.php	(revision 1938)
@@ -12,18 +12,22 @@
 /**
  * Autoloads Twig classes.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Autoloader
 {
     /**
      * Registers Twig_Autoloader as an SPL autoloader.
+     *
+     * @param Boolean $prepend Whether to prepend the autoloader or not.
      */
-    public static function register()
+    public static function register($prepend = false)
     {
-        ini_set('unserialize_callback_func', 'spl_autoload_call');
-        spl_autoload_register(array(new self, 'autoload'));
+        if (version_compare(phpversion(), '5.3.0', '>=')) {
+            spl_autoload_register(array(new self, 'autoload'), true, $prepend);
+        } else {
+            spl_autoload_register(array(new self, 'autoload'));
+        }
     }
 
     /**
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Markup.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Markup.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Markup.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Marks a content as safe.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Markup implements Countable
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Method.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Method.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Method.php	(revision 1938)
@@ -15,8 +15,7 @@
  *
  * Use Twig_SimpleFunction instead.
  *
- * @package    twig
- * @author     Arnaud Le Blanc <arnaud.lb@gmail.com>
+ * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Function_Method extends Twig_Function
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Function.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Function.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Function.php	(revision 1938)
@@ -15,8 +15,7 @@
  *
  * Use Twig_SimpleFunction instead.
  *
- * @package    twig
- * @author     Arnaud Le Blanc <arnaud.lb@gmail.com>
+ * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Function_Function extends Twig_Function
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Node.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Node.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Function/Node.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFunction instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_Function_Node extends Twig_Function
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleFilter.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleFilter.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/SimpleFilter.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a template filter.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_SimpleFilter
 {
@@ -81,8 +80,6 @@
         if (null !== $this->options['is_safe_callback']) {
             return call_user_func($this->options['is_safe_callback'], $filterArgs);
         }
-
-        return null;
     }
 
     public function getPreservesSafety()
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserBroker.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserBroker.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/TokenParserBroker.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Default implementation of a token parser broker.
  *
- * @package    twig
- * @author     Arnaud Le Blanc <arnaud.lb@gmail.com>
+ * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
@@ -112,8 +111,6 @@
             }
             $broker = prev($this->brokers);
         }
-
-        return null;
     }
 
     public function getParsers()
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Runtime.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Runtime.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Runtime.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Exception thrown when an error occurs at runtime.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Error_Runtime extends Twig_Error
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Loader.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Loader.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Loader.php	(revision 1938)
@@ -20,8 +20,7 @@
  *
  * This strategy makes Twig_Environment::resolveTemplate() much faster.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Error_Loader extends Twig_Error
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Syntax.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Syntax.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error/Syntax.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Exception thrown when a syntax error occurs during lexing or parsing of a template.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Error_Syntax extends Twig_Error
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Environment.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Environment.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Environment.php	(revision 1938)
@@ -12,12 +12,11 @@
 /**
  * Stores the Twig configuration.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Environment
 {
-    const VERSION = '1.12.2';
+    const VERSION = '1.13.1';
 
     protected $charset;
     protected $loader;
@@ -54,7 +53,7 @@
      *  * debug: When set to true, it automatically set "auto_reload" to true as
      *           well (default to false).
      *
-     *  * charset: The charset used by the templates (default to utf-8).
+     *  * charset: The charset used by the templates (default to UTF-8).
      *
      *  * base_template_class: The base template class to use for generated
      *                         templates (default to Twig_Template).
@@ -100,7 +99,7 @@
         ), $options);
 
         $this->debug              = (bool) $options['debug'];
-        $this->charset            = $options['charset'];
+        $this->charset            = strtoupper($options['charset']);
         $this->baseTemplateClass  = $options['base_template_class'];
         $this->autoReload         = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
         $this->strictVariables    = (bool) $options['strict_variables'];
@@ -567,7 +566,7 @@
      */
     public function setCharset($charset)
     {
-        $this->charset = $charset;
+        $this->charset = strtoupper($charset);
     }
 
     /**
@@ -757,10 +756,6 @@
      */
     public function addFilter($name, $filter = null)
     {
-        if ($this->extensionInitialized) {
-            throw new LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $name));
-        }
-
         if (!$name instanceof Twig_SimpleFilter && !($filter instanceof Twig_SimpleFilter || $filter instanceof Twig_FilterInterface)) {
             throw new LogicException('A filter must be an instance of Twig_FilterInterface or Twig_SimpleFilter');
         }
@@ -769,7 +764,11 @@
             $filter = $name;
             $name = $filter->getName();
         }
-
+        
+        if ($this->extensionInitialized) {
+            throw new LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $name));
+        }
+        
         $this->staging->addFilter($name, $filter);
     }
 
@@ -846,10 +845,6 @@
      */
     public function addTest($name, $test = null)
     {
-        if ($this->extensionInitialized) {
-            throw new LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $name));
-        }
-
         if (!$name instanceof Twig_SimpleTest && !($test instanceof Twig_SimpleTest || $test instanceof Twig_TestInterface)) {
             throw new LogicException('A test must be an instance of Twig_TestInterface or Twig_SimpleTest');
         }
@@ -858,6 +853,10 @@
             $test = $name;
             $name = $test->getName();
         }
+        
+        if ($this->extensionInitialized) {
+            throw new LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $name));
+        }
 
         $this->staging->addTest($name, $test);
     }
@@ -904,10 +903,6 @@
      */
     public function addFunction($name, $function = null)
     {
-        if ($this->extensionInitialized) {
-            throw new LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $name));
-        }
-
         if (!$name instanceof Twig_SimpleFunction && !($function instanceof Twig_SimpleFunction || $function instanceof Twig_FunctionInterface)) {
             throw new LogicException('A function must be an instance of Twig_FunctionInterface or Twig_SimpleFunction');
         }
@@ -916,7 +911,11 @@
             $function = $name;
             $name = $function->getName();
         }
-
+        
+        if ($this->extensionInitialized) {
+            throw new LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $name));
+        }
+        
         $this->staging->addFunction($name, $function);
     }
 
@@ -1100,10 +1099,17 @@
     {
         $globals = array();
         foreach ($this->extensions as $extension) {
-            $globals = array_merge($globals, $extension->getGlobals());
+            $extGlob = $extension->getGlobals();
+            if (!is_array($extGlob)) {
+                throw new UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', get_class($extension)));
+            }
+
+            $globals[] = $extGlob;
         }
 
-        return array_merge($globals, $this->staging->getGlobals());
+        $globals[] = $this->staging->getGlobals();
+
+        return call_user_func_array('array_merge', $globals);
     }
 
     protected function initExtensions()
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FunctionInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FunctionInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FunctionInterface.php	(revision 1938)
@@ -15,8 +15,7 @@
  *
  * Use Twig_SimpleFunction instead.
  *
- * @package    twig
- * @author     Arnaud Le Blanc <arnaud.lb@gmail.com>
+ * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_FunctionInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Compiler.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Compiler.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Compiler.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Compiles a node to PHP code.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Compiler implements Twig_CompilerInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExpressionParser.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExpressionParser.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExpressionParser.php	(revision 1938)
@@ -18,8 +18,7 @@
  * @see http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
  * @see http://en.wikipedia.org/wiki/Operator-precedence_parser
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_ExpressionParser
 {
@@ -366,7 +365,7 @@
                 throw new Twig_Error_Syntax('Expected name or number', $lineno, $this->parser->getFilename());
             }
 
-            if ($node instanceof Twig_Node_Expression_Name && null !== $alias = $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
+            if ($node instanceof Twig_Node_Expression_Name && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
                 if (!$arg instanceof Twig_Node_Expression_Constant) {
                     throw new Twig_Error_Syntax(sprintf('Dynamic macro names are not supported (called on "%s")', $node->getAttribute('name')), $token->getLine(), $this->parser->getFilename());
                 }
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ParserInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ParserInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ParserInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Interface implemented by parser classes.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_ParserInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Lexer.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Lexer.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Lexer.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Lexes a template string.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Lexer implements Twig_LexerInterface
 {
@@ -32,6 +31,7 @@
     protected $regexes;
     protected $position;
     protected $positions;
+    protected $currentVarBlockLine;
 
     const STATE_DATA            = 0;
     const STATE_BLOCK           = 1;
@@ -186,6 +186,7 @@
                 } else {
                     $this->pushToken(Twig_Token::BLOCK_START_TYPE);
                     $this->pushState(self::STATE_BLOCK);
+                    $this->currentVarBlockLine = $this->lineno;
                 }
                 break;
 
@@ -192,6 +193,7 @@
             case $this->options['tag_variable'][0]:
                 $this->pushToken(Twig_Token::VAR_START_TYPE);
                 $this->pushState(self::STATE_VAR);
+                $this->currentVarBlockLine = $this->lineno;
                 break;
         }
     }
@@ -225,7 +227,7 @@
             $this->moveCursor($match[0]);
 
             if ($this->cursor >= $this->end) {
-                throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s"', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->lineno, $this->filename);
+                throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->filename);
             }
         }
 
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Test.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a template test.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 abstract class Twig_Test implements Twig_TestInterface, Twig_TestCallableInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Token.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Token.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Token.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a Token.
  *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Token
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node.php	(revision 1938)
@@ -13,8 +13,7 @@
 /**
  * Represents a node in the AST.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 class Twig_Node implements Twig_NodeInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Filter.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFilter instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 abstract class Twig_Filter implements Twig_FilterInterface, Twig_FilterCallableInterface
@@ -63,8 +62,6 @@
         if (isset($this->options['is_safe_callback'])) {
             return call_user_func($this->options['is_safe_callback'], $filterArgs);
         }
-
-        return null;
     }
 
     public function getPreservesSafety()
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FunctionCallableInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FunctionCallableInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/FunctionCallableInterface.php	(revision 1938)
@@ -14,8 +14,7 @@
  *
  * Use Twig_SimpleFunction instead.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_FunctionCallableInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeOutputInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeOutputInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/NodeOutputInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Represents a displayable node in the AST.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 interface Twig_NodeOutputInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/LoaderInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/LoaderInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/LoaderInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Interface all loaders must implement.
  *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
  */
 interface Twig_LoaderInterface
 {
Index: branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExistsLoaderInterface.php
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExistsLoaderInterface.php	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/ExistsLoaderInterface.php	(revision 1938)
@@ -12,8 +12,7 @@
 /**
  * Adds an exists() method for loaders.
  *
- * @package    twig
- * @author     Florin Patan <florinpatan@gmail.com>
+ * @author Florin Patan <florinpatan@gmail.com>
  * @deprecated since 1.12 (to be removed in 2.0)
  */
 interface Twig_ExistsLoaderInterface
Index: branches/2.8.x/wb/include/Sensio/Twig/CHANGELOG
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/CHANGELOG	(revision 1937)
+++ branches/2.8.x/wb/include/Sensio/Twig/CHANGELOG	(revision 1938)
@@ -1,3 +1,28 @@
+* 1.13.1 (2013-06-06)
+
+ * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
+ * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface
+ * adjusted backtrace call to reduce memory usage when an error occurs
+ * added support for object instances as the second argument of the constant test
+ * fixed the include function when used in an assignment
+
+* 1.13.0 (2013-05-10)
+
+ * fixed getting a numeric-like item on a variable ('09' for instance)
+ * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access:
+   `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`)
+ * made the escape filter 20% faster for happy path (escaping string for html with UTF-8)
+ * changed ☃ to § in tests
+ * enforced usage of named arguments after positional ones
+
+* 1.12.3 (2013-04-08)
+
+ * fixed a security issue in the filesystem loader where it was possible to include a template one
+   level above the configured path
+ * fixed fatal error that should be an exception when adding a filter/function/test too late
+ * added a batch filter
+ * added support for encoding an array as query string in the url_encode filter
+
 * 1.12.2 (2013-02-09)
 
  * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00)
@@ -381,7 +406,7 @@
  * enhanced error messages when an unexpected token is parsed in an expression
  * fixed filename not being added to syntax error messages
  * added the autoescape option to enable/disable autoescaping
- * removed the newline after a comment (mimicks PHP behavior)
+ * removed the newline after a comment (mimics PHP behavior)
  * added a syntax error exception when parent block is used on a template that does not extend another one
  * made the Escaper extension enabled by default
  * fixed sandbox extension when used with auto output escaping
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1937)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1938)
@@ -51,5 +51,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.3');
-if(!defined('REVISION')) define('REVISION', '1937');
+if(!defined('REVISION')) define('REVISION', '1938');
 if(!defined('SP')) define('SP', '');
