X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Ftwig%2Ftwig%2Flib%2FTwig%2FLexer.php;h=41211eb28b6c8ac006d4119efef78703e913d8f2;hp=85390b28c75c0963c31528c8da269ef086b30927;hb=refs%2Fheads%2Ft2;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5 diff --git a/vendor/twig/twig/lib/Twig/Lexer.php b/vendor/twig/twig/lib/Twig/Lexer.php index 85390b28c..41211eb28 100644 --- a/vendor/twig/twig/lib/Twig/Lexer.php +++ b/vendor/twig/twig/lib/Twig/Lexer.php @@ -235,7 +235,7 @@ class Twig_Lexer implements Twig_LexerInterface $this->moveCursor($match[0]); if ($this->cursor >= $this->end) { - throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source); + throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', self::STATE_BLOCK === $this->state ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source); } } @@ -337,12 +337,15 @@ class Twig_Lexer implements Twig_LexerInterface $this->moveCursor($match[0]); } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { list($expect, $lineno) = array_pop($this->brackets); - if ($this->code[$this->cursor] != '"') { + if ('"' != $this->code[$this->cursor]) { throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); } $this->popState(); ++$this->cursor; + } else { + // unlexable + throw new Twig_Error_Syntax(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); } }