*/ class Twig_FileExtensionEscapingStrategy { /** * Guesses the best autoescaping strategy based on the file name. * * @param string $filename The template file name * * @return string The escaping strategy name to use */ public static function guess($filename) { if (!preg_match('{\.(js|css|txt)(?:\.[^/\\\\]+)?$}', $filename, $match)) { return 'html'; } switch ($match[1]) { case 'js': return 'js'; case 'css': return 'css'; case 'txt': return false; } } }