phpBB

Code Changes

File: phpbb/template/twig/twig.php

  Unmodified   Added   Modified   Removed
Line 114Line 114
				$this->user
)
);

				$this->user
)
);

 

if (defined('DEBUG'))
{
$this->twig->addExtension(new \Twig_Extension_Debug());
}


$lexer = new \phpbb\template\twig\lexer($this->twig);



$lexer = new \phpbb\template\twig\lexer($this->twig);


Line 280Line 285
						$ext_style_theme_path = $ext_style_path . 'theme/';
}


						$ext_style_theme_path = $ext_style_path . 'theme/';
}


					$ok = false;

					$is_valid_dir = false;

					if (is_dir($ext_style_template_path))
{

					if (is_dir($ext_style_template_path))
{

						$ok = true;

						$is_valid_dir = true;

						$paths[] = $ext_style_template_path;
}
if (is_dir($ext_style_theme_path))
{

						$paths[] = $ext_style_template_path;
}
if (is_dir($ext_style_theme_path))
{

						$ok = true;

						$is_valid_dir = true;

						$paths[] = $ext_style_theme_path;
}


						$paths[] = $ext_style_theme_path;
}


					if ($ok)

					if ($is_valid_dir)

					{
// Add the base style directory as a safe directory
$this->twig->getLoader()->addSafeDirectory($ext_style_path);

					{
// Add the base style directory as a safe directory
$this->twig->getLoader()->addSafeDirectory($ext_style_path);

Line 345Line 350
			return $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars());
}


			return $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars());
}


		$this->assign_var($template_var, $this->twig->render($this->get_filename_from_handle($handle, $this->get_template_vars())));

		$this->assign_var($template_var, $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars()));


return $this;
}


return $this;
}