phpBB

Code Changes

File: phpbb/template/twig/lexer.php

  Unmodified   Added   Modified   Removed
Line 22Line 22

public function tokenize($code, $filename = null)
{


public function tokenize($code, $filename = null)
{

 
		// Handle \Twig_Source format input
if ($code instanceof \Twig_Source)
{
$source = $code;
$code = $source->getCode();
$filename = $source->getName();
}


		// Our phpBB tags
// Commented out tokens are handled separately from the main replace
$phpbb_tags = array(

		// Our phpBB tags
// Commented out tokens are handled separately from the main replace
$phpbb_tags = array(

Line 125Line 133
		// 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);


		return parent::tokenize($code, $filename);


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

	}

/**

	}

/**