Browse Source

XmlView: check _serialize keys before using them

Before adding a view var to `$data`, make sure it exists.

this fixes #7067
catearcher 10 years ago
parent
commit
aed215fb50
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/View/XmlView.php

+ 3 - 1
src/View/XmlView.php

@@ -148,7 +148,9 @@ class XmlView extends View
                 if (is_numeric($alias)) {
                     $alias = $key;
                 }
-                $data[$rootNode][$alias] = $this->viewVars[$key];
+                if (array_key_exists($key, $this->viewVars)) {
+                    $data[$rootNode][$alias] = $this->viewVars[$key];
+                }
             }
         } else {
             $data = isset($this->viewVars[$serialize]) ? $this->viewVars[$serialize] : null;