Fixed root context swap in clone (was checking context[0], should have checked last element in context stack).
This commit is contained in:
+4
-2
@@ -92,9 +92,11 @@ class Mustache {
|
|||||||
$this->_otag = '{{';
|
$this->_otag = '{{';
|
||||||
$this->_ctag = '}}';
|
$this->_ctag = '}}';
|
||||||
$this->_localPragmas = null;
|
$this->_localPragmas = null;
|
||||||
|
|
||||||
if ($keys = array_keys($this->_context)) {
|
if ($keys = array_keys($this->_context)) {
|
||||||
if ($this->_context[$keys[0]] instanceof Mustache) {
|
$last = array_pop($keys);
|
||||||
$this->_context[$keys[0]] =& $this;
|
if ($this->_context[$last] instanceof Mustache) {
|
||||||
|
$this->_context[$last] =& $this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user