mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
Merge pull request #38 from ulriklystbaek/patch-1
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:
commit
c83e0fbbf7
@ -10,6 +10,7 @@
|
||||
* @author fzerorubigd <fzerorubigd@gmail.com>
|
||||
* @author Behrooz Shabani <everplays@gmail.com>
|
||||
* @author Chris Gray <chris.w.gray@gmail.com>
|
||||
* @author Ulrik Lystbaek <ulrik@bettertaste.dk>
|
||||
* @copyright 2012 (c) ParsPooyesh Co
|
||||
* @copyright 2013 (c) Behrooz Shabani
|
||||
* @copyright 2013 (c) f0ruD A
|
||||
@ -254,7 +255,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);
|
||||
|
Loading…
Reference in New Issue
Block a user