You are here

public function Twig_Extension_Escaper::getDefaultStrategy in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/Extension/Escaper.php \Twig_Extension_Escaper::getDefaultStrategy()

Gets the default strategy to use when not defined by the user.

Parameters

string $filename The template "filename":

Return value

string|false The default strategy to use for the template

File

vendor/twig/twig/lib/Twig/Extension/Escaper.php, line 75

Class

Twig_Extension_Escaper

Code

public function getDefaultStrategy($filename) {

  // disable string callables to avoid calling a function named html or js,
  // or any other upcoming escaping strategy
  if (!is_string($this->defaultStrategy) && false !== $this->defaultStrategy) {
    return call_user_func($this->defaultStrategy, $filename);
  }
  return $this->defaultStrategy;
}