From: Joseph Bielawski Date: Wed, 27 Apr 2011 14:57:39 +0000 (-0700) Subject: Fix for issue #307 X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=36143a6b6c4672ce7877bcce5102b99d67095c34;p=web%2Fkonrad%2Ftwig.git Fix for issue #307 --- diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 9a34d6a..5429c07 100644 --- 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; }