Skip to content

Commit c979fb2

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: prefer getSourceContext() over getSource() [HttpFoundation] Avoid implicit null to array conversion in request matcher Revert "bug #20184 [FrameworkBundle] Convert null prefix to an empty string in translation:update (chalasr)" Update UPGRADE-2.7.md
2 parents 278a393 + 04ab1f3 commit c979fb2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Fragment/HIncludeFragmentRenderer.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,16 @@ private function templateExists($template)
140140
}
141141

142142
$loader = $this->templating->getLoader();
143-
if ($loader instanceof \Twig_ExistsLoaderInterface) {
143+
if ($loader instanceof \Twig_ExistsLoaderInterface || method_exists($loader, 'exists')) {
144144
return $loader->exists($template);
145145
}
146146

147147
try {
148-
$loader->getSource($template);
148+
if (method_exists($loader, 'getSourceContext')) {
149+
$loader->getSourceContext($template);
150+
} else {
151+
$loader->getSource($template);
152+
}
149153

150154
return true;
151155
} catch (\Twig_Error_Loader $e) {

0 commit comments

Comments
 (0)