diff --git a/core/lib/Drupal/Core/Template/TwigSandboxPolicy.php b/core/lib/Drupal/Core/Template/TwigSandboxPolicy.php index 8d5034c..7b768f7 100644 --- a/core/lib/Drupal/Core/Template/TwigSandboxPolicy.php +++ b/core/lib/Drupal/Core/Template/TwigSandboxPolicy.php @@ -45,7 +45,7 @@ public function checkMethodAllowed($obj, $method) { static $whitelisted_methods = NULL; static $whitelisted_prefixes = NULL; - if (is_null($whitelisted_methods) || is_null($whitelisted_prefixes)) { + if (!isset($whitelisted_methods) || !isset($whitelisted_prefixes)) { $whitelisted_methods = Settings::get('twig_sandbox_whitelisted_methods') ?: [ // Only allow idempotent methods. Note: using the form method_name => // TRUE allows us to use isset() which is faster than in_array().