make sure that buffer is always a string

This commit is contained in:
behrooz shabani (everplays) 2014-08-20 13:08:33 +04:30
parent 35ea671fd7
commit 07c49bbb3f

View File

@ -100,7 +100,7 @@ class Tokenizer
protected $state;
protected $tagType;
protected $tag;
protected $buffer;
protected $buffer = '';
protected $tokens;
protected $seenTag;
protected $lineStart;
@ -294,7 +294,7 @@ class Tokenizer
*/
protected function flushBuffer()
{
if (!empty($this->buffer) or $this->buffer === '0') {
if ($this->buffer !== '') {
$this->tokens[] = array(
self::TYPE => self::T_TEXT,
self::VALUE => $this->buffer