mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-03-22 08:21:23 +03:00
more escaping related fixes
This commit is contained in:
parent
d719bd12ca
commit
4e0ed3c7ae
@ -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();
|
||||
|
@ -142,6 +142,11 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
||||
array(),
|
||||
'\pi'
|
||||
),
|
||||
array(
|
||||
'\\\\\\\\qux',
|
||||
array(),
|
||||
'\\\\\\\\qux'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user