// Customize the list of extensions if no file extension is allowed.
$extensions =
$this->allowedFileExtensions;
$no_extension =
array_search('',
$extensions, TRUE
);
if (is_int($no_extension)) { unset($extensions[$no_extension]);
$extensions[] = 'or no file extension';
} if (empty($extension)) { $extension = 'no file extension';
} throw new LoaderError(sprintf("Template %s has an invalid file extension (%s). Only templates ending in one of %s are allowed. Set the twig.config.allowed_file_extensions container parameter to customize the allowed file extensions",
$name,
$extension,
implode(', ',
$extensions)));
} // Previously it was possible to access files in the parent directory of a
// namespace. This was removed in Twig 2.15.3. In order to support backwards
// compatibility, we are adding path directory as a namespace, and therefore
// we can remove the directory traversal from the name.
// @todo deprecate this functionality for removal in Drupal 11.
if (preg_match('/(^\@[^\/]+\/)\.\.\/(.*)/',
$name,
$matches)) { $name =
$matches[1
] .
$matches[2
];
}