1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 07:21:30 +02:00

Merge branch '3.3.x'

This commit is contained in:
Marc Alexander
2020-03-01 21:41:03 +01:00
25 changed files with 134 additions and 133 deletions

View File

@@ -18,7 +18,7 @@ use phpbb\filesystem\helper as filesystem_helper;
/**
* Twig Template loader
*/
class loader extends \Twig_Loader_Filesystem
class loader extends \Twig\Loader\FilesystemLoader
{
protected $safe_directories = array();
@@ -36,7 +36,7 @@ class loader extends \Twig_Loader_Filesystem
* Set safe directories
*
* @param array $directories Array of directories that are safe (empty to clear)
* @return \Twig_Loader_Filesystem
* @return \Twig\Loader\FilesystemLoader
*/
public function setSafeDirectories($directories = array())
{
@@ -57,7 +57,7 @@ class loader extends \Twig_Loader_Filesystem
* Add safe directory
*
* @param string $directory Directory that should be added
* @return \Twig_Loader_Filesystem
* @return \Twig\Loader\FilesystemLoader
*/
public function addSafeDirectory($directory)
{
@@ -105,11 +105,11 @@ class loader extends \Twig_Loader_Filesystem
}
/**
* Find the template
*
* Override for Twig_Loader_Filesystem::findTemplate to add support
* for loading from safe directories.
*/
* Find the template
*
* Override for \Twig\Loader\FilesystemLoader::findTemplate
* to add support for loading from safe directories.
*/
protected function findTemplate($name, $throw = true)
{
$name = (string) $name;
@@ -133,7 +133,7 @@ class loader extends \Twig_Loader_Filesystem
// Try validating the name (which may throw an exception)
$this->validateName($name);
}
catch (\Twig_Error_Loader $e)
catch (\Twig\Error\LoaderError $e)
{
if (strpos($e->getRawMessage(), 'Looks like you try to load a template outside configured directories') === 0)
{