diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 7b2abb2..d0d8779 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -472,8 +472,8 @@ public function escapeFilter(\Twig_Environment $env, $arg, $strategy = 'html', $ throw new \Exception('Object of type ' . get_class($arg) . ' cannot be printed.'); } } - elseif (is_array($arg)) { - throw new \Exception('Render arrays cannot be printed.'); + else { + throw new \Exception('Variable of type ' . gettype($arg) . ' cannot be printed.'); } // We have a string or an object converted to a string: Autoescape it! @@ -587,9 +587,7 @@ public function renderVar($arg) { throw new \Exception('Object of type ' . get_class($arg) . ' cannot be printed.'); } } - elseif (is_array($arg)) { - throw new \Exception('Render arrays cannot be printed.'); - } + throw new \Exception('Variable of type ' . gettype($arg) . ' cannot be printed.'); } /**