mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-03 18:43:07 +03:00
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.
This commit is contained in:
parent
21b3bf9797
commit
4e2c869d3b
@ -254,7 +254,7 @@ class Context
|
|||||||
if (($inside !== '0' && empty($inside)) || ($inside == 'this')) {
|
if (($inside !== '0' && empty($inside)) || ($inside == 'this')) {
|
||||||
return $variable;
|
return $variable;
|
||||||
} elseif (is_array($variable)) {
|
} elseif (is_array($variable)) {
|
||||||
if (isset($variable[$inside])) {
|
if (isset($variable[$inside]) || array_key_exists($inside, $variable)) {
|
||||||
return $variable[$inside];
|
return $variable[$inside];
|
||||||
} elseif ($inside == "length") {
|
} elseif ($inside == "length") {
|
||||||
return count($variable);
|
return count($variable);
|
||||||
|
Loading…
Reference in New Issue
Block a user