mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-03-24 01:07:07 +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);
|
$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 .= "\\";
|
$this->buffer .= "\\";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ class Tokenizer
|
|||||||
$this->flushBuffer();
|
$this->flushBuffer();
|
||||||
$this->state = self::IN_TAG_TYPE;
|
$this->state = self::IN_TAG_TYPE;
|
||||||
} elseif ($this->escaped and $this->escaping) {
|
} elseif ($this->escaped and $this->escaping) {
|
||||||
$this->buffer .= "\\\\";
|
$this->buffer .= "\\";
|
||||||
} elseif (!$this->escaping) {
|
} elseif (!$this->escaping) {
|
||||||
if ($text[$i] == "\n") {
|
if ($text[$i] == "\n") {
|
||||||
$this->filterLine();
|
$this->filterLine();
|
||||||
|
@ -142,6 +142,11 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
|||||||
array(),
|
array(),
|
||||||
'\pi'
|
'\pi'
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'\\\\\\\\qux',
|
||||||
|
array(),
|
||||||
|
'\\\\\\\\qux'
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user