Fixed root context swap in clone (was checking context[0], should have checked last element in context stack).

This commit is contained in:
Justin Hileman
2010-05-22 22:42:54 -04:00
parent 619a48674b
commit eb1a896569
+4 -2
View File
@@ -92,9 +92,11 @@ class Mustache {
$this->_otag = '{{';
$this->_ctag = '}}';
$this->_localPragmas = null;
if ($keys = array_keys($this->_context)) {
if ($this->_context[$keys[0]] instanceof Mustache) {
$this->_context[$keys[0]] =& $this;
$last = array_pop($keys);
if ($this->_context[$last] instanceof Mustache) {
$this->_context[$last] =& $this;
}
}
}