public function 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 The default strategy to use for the template

File

drupal/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php, line 77

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) && is_callable($this->defaultStrategy)) {
    return call_user_func($this->defaultStrategy, $filename);
  }
  return $this->defaultStrategy;
}