mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-02 10:16:41 +03:00
fix a bug with stop token (when there is no stop token at all)
This commit is contained in:
parent
9fb753f75c
commit
4244730d24
@ -138,10 +138,6 @@ class Handlebars_Template
|
|||||||
&& $current[Handlebars_Tokenizer::TYPE] == Handlebars_Tokenizer::T_ESCAPED
|
&& $current[Handlebars_Tokenizer::TYPE] == Handlebars_Tokenizer::T_ESCAPED
|
||||||
&& $current[Handlebars_Tokenizer::NAME] === $this->_stopToken
|
&& $current[Handlebars_Tokenizer::NAME] === $this->_stopToken
|
||||||
) {
|
) {
|
||||||
//Ok break here, the helper should be aware of this.
|
|
||||||
$newStack = array_pop($this->_stack);
|
|
||||||
$newStack[0] = $index;
|
|
||||||
array_push($this->_stack, $newStack);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch ($current[Handlebars_Tokenizer::TYPE]) {
|
switch ($current[Handlebars_Tokenizer::TYPE]) {
|
||||||
@ -172,6 +168,10 @@ class Handlebars_Template
|
|||||||
throw new RuntimeException('Invalid node type : ' . json_encode($current));
|
throw new RuntimeException('Invalid node type : ' . json_encode($current));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Ok break here, the helper should be aware of this.
|
||||||
|
$newStack = array_pop($this->_stack);
|
||||||
|
$newStack[0] = $index;
|
||||||
|
array_push($this->_stack, $newStack);
|
||||||
return $buffer;
|
return $buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,13 +198,13 @@ class Handlebars_Template
|
|||||||
&& $current[Handlebars_Tokenizer::TYPE] == Handlebars_Tokenizer::T_ESCAPED
|
&& $current[Handlebars_Tokenizer::TYPE] == Handlebars_Tokenizer::T_ESCAPED
|
||||||
&& $current[Handlebars_Tokenizer::NAME] === $this->_stopToken
|
&& $current[Handlebars_Tokenizer::NAME] === $this->_stopToken
|
||||||
) {
|
) {
|
||||||
//Ok break here, the helper should be aware of this.
|
|
||||||
$newStack = array_pop($this->_stack);
|
|
||||||
$newStack[0] = $index;
|
|
||||||
array_push($this->_stack, $newStack);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Ok break here, the helper should be aware of this.
|
||||||
|
$newStack = array_pop($this->_stack);
|
||||||
|
$newStack[0] = $index;
|
||||||
|
array_push($this->_stack, $newStack);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user