bug #2760 Make sure twig_include returns a string (thewilkybarkid)

This PR was merged into the 1.x branch.

Discussion
----------

Make sure twig_include returns a string

Currently returns `null` if `$ignoreMissing` is `true` and it's not found, but the return type is `string`.

Commits
-------

a55f76bf Make sure twig_include returns a string
This commit is contained in:
Fabien Potencier
2018-10-12 05:58:49 -07:00
+1 -1
View File
@@ -1527,7 +1527,7 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a
}
}
$result = null;
$result = '';
try {
$result = $env->resolveTemplate($template)->render($variables);
} catch (Twig_Error_Loader $e) {