From 6319950bcab9a9c6e870a35a601560ff8c092c07 Mon Sep 17 00:00:00 2001 From: "behrooz shabani (everplays)" Date: Mon, 29 Oct 2012 15:42:42 +0330 Subject: [PATCH] we shouldn't compare context with string as __toString will be called --- src/Handlebars/Context.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Handlebars/Context.php b/src/Handlebars/Context.php index 173a62c..596c5ab 100644 --- a/src/Handlebars/Context.php +++ b/src/Handlebars/Context.php @@ -8,6 +8,7 @@ * @category Xamin * @package Handlebars * @author fzerorubigd + * @author Behrooz Shabani * @copyright 2012 (c) ParsPooyesh Co * @license GPLv3 * @version GIT: $Id$ @@ -21,6 +22,7 @@ * @category Xamin * @package Handlebars * @author fzerorubigd + * @author Behrooz Shabani * @copyright 2012 (c) ParsPooyesh Co * @license GPLv3 * @version Release: @package_version@ @@ -125,7 +127,7 @@ class Handlebars_Context } else { $chunks = explode('.', $variableName); foreach ($chunks as $chunk) { - if ($current == '') { + if (is_string($current) and $current == '') { return $current; } $current = $this->_findVariableInContext($current, $chunk);