Browse code

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

Fabien Potencier authored on 12/10/2018 12:58:49
Showing 1 changed files
... ...
@@ -1527,7 +1527,7 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a
1527 1527
         }
1528 1528
     }
1529 1529
 
1530
-    $result = null;
1530
+    $result = '';
1531 1531
     try {
1532 1532
         $result = $env->resolveTemplate($template)->render($variables);
1533 1533
     } catch (Twig_Error_Loader $e) {