From 674dd2d90930b5b27a1a07a14554c58b258343ed Mon Sep 17 00:00:00 2001 From: Danil Chekalin Date: Thu, 19 Jun 2014 23:49:00 +0700 Subject: [PATCH] Fix crash last ',' in array --- src/Fenom/Template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fenom/Template.php b/src/Fenom/Template.php index edff568..fc42003 100644 --- a/src/Fenom/Template.php +++ b/src/Fenom/Template.php @@ -1313,7 +1313,7 @@ class Template extends Render $_arr .= $this->parseArray($tokens); $key = false; $val = true; - } elseif ($tokens->is(']') && !$key) { + } elseif ($tokens->is(']') && (!$key || $tokens->prev[0] === ',')) { $tokens->next(); return $_arr . ')'; } else {