From 2ffa4ae4253276af4c1266b73df3ddaf7ddf0051 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Fri, 25 Oct 2013 01:37:29 +0200 Subject: Fixed potential bug in VariableNode::transcompile Also now PHP doesn't throw notices here. --- stupid_template_engine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stupid_template_engine.php b/stupid_template_engine.php index 0eef489..db9028a 100644 --- a/stupid_template_engine.php +++ b/stupid_template_engine.php @@ -55,7 +55,7 @@ class VariableNode extends ASTNode $varaccess = '@$ste->vars[' . (is_numeric($this->name) ? $this->name : '"' . escape_text($this->name) . '"'). ']'; foreach($this->arrayfields as $af) { - if((count($af) == 1) and ($af[0] instanceof TextNode) and is_numeric($af->text)) + if((count($af) == 1) and ($af[0] instanceof TextNode) and is_numeric($af[0]->text)) $varaccess .= '[' . $af->text . ']'; else $varaccess .= '[' . implode(".", -- cgit v1.2.3-54-g00ecf