added deprecation for the raw tag

This commit is contained in:
Fabien Potencier
2015-08-15 23:57:31 +02:00
parent efcfe8e0d7
commit 21f536bc0a
+4
View File
@@ -287,6 +287,10 @@ class Twig_Lexer implements Twig_LexerInterface
protected function lexRawData($tag)
{
if ('raw' === $tag) {
@trigger_error(sprintf('Twig Tag "raw" is deprecated. Use "verbatim" instead in %s at line %d.', $this->filename, $this->lineno), E_USER_DEPRECATED);
}
if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block', $tag), $this->lineno, $this->filename);
}