From: Andrei Shevchuk Date: Sun, 20 Nov 2011 17:39:44 +0000 (+0400) Subject: !empty($date[0]) → !empty($date) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=5f30db0f4140666378736853f6a243d8ea8dda1d;p=web%2Fkonrad%2Ftwig.git !empty($date[0]) → !empty($date) --- diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 11a0ee4..215ec6f 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -238,7 +238,7 @@ function twig_date_format_filter($date, $format = 'F j, Y H:i', $timezone = null { if (!$date instanceof DateTime && !$date instanceof DateInterval) { if (ctype_digit((string) $date) - || (!empty($date[0]) + || (!empty($date) && ('-' === $date[0]) && ctype_digit(substr($date, 1))) ) {