From 4e2c869d3bcb15d817d26205ccfca7bff4018da9 Mon Sep 17 00:00:00 2001 From: ulriklystbaek Date: Tue, 21 Jan 2014 09:23:54 +0100 Subject: [PATCH] Update Context.php If the array contains the given key with a null value, the null value should be returned instead of an empty string. --- src/Handlebars/Context.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handlebars/Context.php b/src/Handlebars/Context.php index 2bc251e..b9d0911 100755 --- a/src/Handlebars/Context.php +++ b/src/Handlebars/Context.php @@ -254,7 +254,7 @@ class Context if (($inside !== '0' && empty($inside)) || ($inside == 'this')) { return $variable; } elseif (is_array($variable)) { - if (isset($variable[$inside])) { + if (isset($variable[$inside]) || array_key_exists($inside, $variable)) { return $variable[$inside]; } elseif ($inside == "length") { return count($variable);