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