Skip to content

Commit

Permalink
XmlView: check _serialize keys before using them
Browse files Browse the repository at this point in the history
Before adding a view var to `$data`, make sure it exists.

this fixes #7067
  • Loading branch information
catearcher committed Jul 20, 2015
1 parent 66262e5 commit aed215f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/View/XmlView.php
Expand Up @@ -148,7 +148,9 @@ protected function _serialize($serialize)
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;
Expand Down

0 comments on commit aed215f

Please sign in to comment.