phpBB

Code Changes

File: phpbb/template/twig/lexer.php

  Unmodified   Added   Modified   Removed
Line 13Line 13

namespace phpbb\template\twig;



namespace phpbb\template\twig;


class lexer extends \Twig_Lexer

class lexer extends \Twig\Lexer

{

{

	public function tokenize(\Twig_Source $source)

	public function tokenize(\Twig\Source $source)

	{
$code = $source->getCode();
$filename = $source->getName();

	{
$code = $source->getCode();
$filename = $source->getName();

Line 72Line 72
			'endspaceless',
'verbatim',
'endverbatim',

			'endspaceless',
'verbatim',
'endverbatim',

 
			'apply',
'endapply',

		);

// Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}')

		);

// Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}')

Line 123Line 125
		// Appends any filters
$code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code);


		// Appends any filters
$code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code);


		// Tokenize \Twig_Source instance
return parent::tokenize(new \Twig_Source($code, $filename));

		// Tokenize \Twig\Source instance
return parent::tokenize(new \Twig\Source($code, $filename));

	}

/**

	}

/**