changed the default value of strict_variables to false
authorFabien Potencier <fabien.potencier@gmail.com>
Sat, 12 Jun 2010 14:46:54 +0000 (16:46 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Sat, 12 Jun 2010 14:47:14 +0000 (16:47 +0200)
CHANGELOG
doc/03-Twig-for-Developers.markdown
lib/Twig/Environment.php

index 46d1302..f5c98a1 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -16,7 +16,7 @@ Backward incompatibilities:
  * added a bunch of phpdoc
  * added a sandbox tag in the sandbox extension
  * changed the date filter to support any date format supported by DateTime
- * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default when debug is false)
+ * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default)
  * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor
  * changed the cache option to only accepts an explicit path to a cache directory or false
  * added a way to add token parsers, filters, and visitors without creating an extension
index b2d7a6d..9b75b70 100644 (file)
@@ -96,9 +96,7 @@ The following options are available:
  * `strict_variables` (new in Twig 0.9.7): If set to `false`, Twig will
    silently ignore invalid variables (variables and or attributes/methods that
    do not exist) and replace them with a `null` value. When set to `true`,
-   Twig throws an exception instead. If you don't provide a value for the
-   `strict_variables` option, it will be determined automatically based on the
-   `debug` value.
+   Twig throws an exception instead (default to `false`).
 
 >**CAUTION**
 >Before Twig 0.9.3, the `cache` and `auto_reload` options did not exist. They
index 57c4808..9b33e2f 100644 (file)
@@ -56,7 +56,7 @@ class Twig_Environment
      *                 determined automatically base on the debug value.
      *
      *  * strict_variables: Whether to ignore invalid variables in templates
-     *                      (default to the value of debug).
+     *                      (default to false).
      *
      * @param Twig_LoaderInterface   $loader  A Twig_LoaderInterface instance
      * @param array                  $options An array of options
@@ -80,7 +80,7 @@ class Twig_Environment
         $this->baseTemplateClass  = isset($options['base_template_class']) ? $options['base_template_class'] : 'Twig_Template';
         $this->autoReload         = isset($options['auto_reload']) ? (bool) $options['auto_reload'] : $this->debug;
         $this->extensions         = array('core' => new Twig_Extension_Core());
-        $this->strictVariables    = isset($options['strict_variables']) ? (bool) $options['strict_variables'] : $this->debug;
+        $this->strictVariables    = isset($options['strict_variables']) ? (bool) $options['strict_variables'] : false;
         $this->runtimeInitialized = false;
         if (isset($options['cache']) && $options['cache']) {
             $this->setCache($options['cache']);