safety check in Utils::svgImageFunction()

This commit is contained in:
Andy Miller
2020-09-11 14:48:50 -06:00
parent 1995837b3f
commit 20c4468edd

View File

@@ -1426,7 +1426,7 @@ class TwigExtension extends AbstractExtension implements GlobalsInterface
$classes = $classes ?: '';
if (file_exists($path)) {
if (file_exists($path) && !is_dir($path)) {
$svg = file_get_contents($path);
$classes = " inline-block $classes";
$matched = false;