Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1957)
+++ branches/2.8.x/CHANGELOG	(revision 1958)
@@ -11,6 +11,8 @@
 ! = Update/Change
 ===============================================================================
 
+14 Aug-2013 Build 1958 M.v.d.Decken(DarkViper)
+! update Twig 1.13.1 -> 1.13.2
 14 Aug-2013 Build 1957 M.v.d.Decken(DarkViper)
 # typofixes in /admin/pages/setings.php
 # typofixes in /include/jscalendar/lang/
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 1957)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Node/Expression/Call.php	(revision 1958)
@@ -146,7 +146,7 @@
 
             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')));
+                    throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name')));
                 }
 
                 $arguments[] = $parameters[$name];
@@ -164,8 +164,8 @@
             }
         }
 
-        foreach (array_keys($parameters) as $name) {
-            throw new Twig_Error_Syntax(sprintf('Unknown argument "%s" for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name')));
+        if (!empty($parameters)) {
+            throw new Twig_Error_Syntax(sprintf('Unknown argument%s "%s" for %s "%s".', count($parameters) > 1 ? 's' : '' , implode('", "', array_keys($parameters)), $this->getAttribute('type'), $this->getAttribute('name')));
         }
 
         return $arguments;
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 1957)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Loader/Filesystem.php	(revision 1958)
@@ -16,6 +16,9 @@
  */
 class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
 {
+    /** Identifier of the main namespace. */
+    const MAIN_NAMESPACE = '__main__';
+
     protected $paths;
     protected $cache;
 
@@ -38,7 +41,7 @@
      *
      * @return array The array of paths where to look for templates
      */
-    public function getPaths($namespace = '__main__')
+    public function getPaths($namespace = self::MAIN_NAMESPACE)
     {
         return isset($this->paths[$namespace]) ? $this->paths[$namespace] : array();
     }
@@ -46,7 +49,7 @@
     /**
      * Returns the path namespaces.
      *
-     * The "__main__" namespace is always defined.
+     * The main namespace is always defined.
      *
      * @return array The array of defined namespaces
      */
@@ -61,7 +64,7 @@
      * @param string|array $paths     A path or an array of paths where to look for templates
      * @param string       $namespace A path namespace
      */
-    public function setPaths($paths, $namespace = '__main__')
+    public function setPaths($paths, $namespace = self::MAIN_NAMESPACE)
     {
         if (!is_array($paths)) {
             $paths = array($paths);
@@ -81,7 +84,7 @@
      *
      * @throws Twig_Error_Loader
      */
-    public function addPath($path, $namespace = '__main__')
+    public function addPath($path, $namespace = self::MAIN_NAMESPACE)
     {
         // invalidate the cache
         $this->cache = array();
@@ -101,7 +104,7 @@
      *
      * @throws Twig_Error_Loader
      */
-    public function prependPath($path, $namespace = '__main__')
+    public function prependPath($path, $namespace = self::MAIN_NAMESPACE)
     {
         // invalidate the cache
         $this->cache = array();
@@ -175,7 +178,7 @@
 
         $this->validateName($name);
 
-        $namespace = '__main__';
+        $namespace = self::MAIN_NAMESPACE;
         if (isset($name[0]) && '@' == $name[0]) {
             if (false === $pos = strpos($name, '/')) {
                 throw new Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name));
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 1957)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Error.php	(revision 1958)
@@ -186,6 +186,7 @@
     protected function guessTemplateInfo()
     {
         $template = null;
+        $templateClass = null;
 
         if (version_compare(phpversion(), '5.3.6', '>=')) {
             $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);
@@ -195,8 +196,11 @@
 
         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()) {
+                $currentClass = get_class($trace['object']);
+                $isEmbedContainer = 0 === strpos($templateClass, $currentClass);
+                if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) {
                     $template = $trace['object'];
+                    $templateClass = get_class($trace['object']);
                 }
             }
         }
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 1957)
+++ branches/2.8.x/wb/include/Sensio/Twig/lib/Twig/Environment.php	(revision 1958)
@@ -16,7 +16,7 @@
  */
 class Twig_Environment
 {
-    const VERSION = '1.13.1';
+    const VERSION = '1.13.2';
 
     protected $charset;
     protected $loader;
@@ -728,7 +728,7 @@
     public function addNodeVisitor(Twig_NodeVisitorInterface $visitor)
     {
         if ($this->extensionInitialized) {
-            throw new LogicException('Unable to add a node visitor as extensions have already been initialized.', $extension->getName());
+            throw new LogicException('Unable to add a node visitor as extensions have already been initialized.');
         }
 
         $this->staging->addNodeVisitor($visitor);
Index: branches/2.8.x/wb/include/Sensio/Twig/CHANGELOG
===================================================================
--- branches/2.8.x/wb/include/Sensio/Twig/CHANGELOG	(revision 1957)
+++ branches/2.8.x/wb/include/Sensio/Twig/CHANGELOG	(revision 1958)
@@ -1,3 +1,8 @@
+* 1.13.2 (2013-08-03)
+
+ * fixed the error line number for an error occurs in and embedded template
+ * fixed crashes of the C extension on some edge cases
+
 * 1.13.1 (2013-06-06)
 
  * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1957)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1958)
@@ -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', '1956');
+if(!defined('REVISION')) define('REVISION', '1958');
 if(!defined('SP')) define('SP', '');
