projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
1e09c7b
)
Fix for issue #307
author
Joseph Bielawski
<stloyd@gmail.com>
Wed, 27 Apr 2011 14:57:39 +0000 (07:57 -0700)
committer
Joseph Bielawski
<stloyd@gmail.com>
Wed, 27 Apr 2011 14:57:39 +0000 (07:57 -0700)
lib/Twig/Extension/Core.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Extension/Core.php
b/lib/Twig/Extension/Core.php
index
9a34d6a
..
5429c07
100644
(file)
--- a/
lib/Twig/Extension/Core.php
+++ b/
lib/Twig/Extension/Core.php
@@
-495,5
+495,9
@@
function twig_test_defined($name, $context)
function twig_test_empty($value)
{
- return null === $value || false === $value || '' === (string) $value;
+ if (null === $value || false === $value) {
+ return true;
+ }
+
+ return empty($value) && '0' != $value;
}