more escaping related fixes

This commit is contained in:
behrooz shabani (everplays) 2014-03-21 03:29:31 +03:30
parent d719bd12ca
commit 4e0ed3c7ae
2 changed files with 7 additions and 2 deletions

View File

@ -127,7 +127,7 @@ class Tokenizer
$this->escaping = $this->tagChange(self::T_ESCAPE, $text, $i);
if ( $this->escaped and $text[$i + 1] != self::T_UNESCAPED ) {
if ( $this->escaped and $text[$i] != self::T_UNESCAPED ) {
$this->buffer .= "\\";
}
@ -142,7 +142,7 @@ class Tokenizer
$this->flushBuffer();
$this->state = self::IN_TAG_TYPE;
} elseif ($this->escaped and $this->escaping) {
$this->buffer .= "\\\\";
$this->buffer .= "\\";
} elseif (!$this->escaping) {
if ($text[$i] == "\n") {
$this->filterLine();

View File

@ -142,6 +142,11 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
array(),
'\pi'
),
array(
'\\\\\\\\qux',
array(),
'\\\\\\\\qux'
),
);
}