mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-20 14:36:57 +00:00
This PR was merged into the 1.x branch.
Discussion
----------
Fix #2431
See title
Commits
-------
a5c2da6d test if is_object before calling method_exists, fixes #2431
This commit is contained in:
@@ -1425,7 +1425,7 @@ function twig_test_empty($value)
|
||||
return 0 == count($value);
|
||||
}
|
||||
|
||||
if (method_exists($value, '__toString')) {
|
||||
if (is_object($value) && method_exists($value, '__toString')) {
|
||||
return '' === (string) $value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user