RemexHtml/Tokenizer/Tokenizer.php
protected function emitDataRange( $pos, $length, $isSimple = false, $hasSimpleRefs = false ) {
		if ( $length === 0 ) {
			return;
		}
		if ( $this->ignoreCharRefs && $this->ignoreNulls && $this->ignoreErrors ) {
			// Pretend this data range doesn't contain < \0 or &
			$isSimple = true;
		}
		if ( $isSimple ) {
			$this->listener->characters( $this->text, $pos, $length, $pos, $length );
		} else {
			if ( !$this->ignoreErrors ) {
				// Any bare "<" in a data state text node is a parse error.
				// Uniquely to the data state, nulls are just flagged as errors
				// and passed through, they are not replaced.
				$this->handleAsciiErrors( "<\0", $this->text, $pos, $length, 0 );
			}

			$text = substr( $this->text, $pos, $length );
			if ( $hasSimpleRefs ) {
				$text = strtr( $text, self::$commonEntities );
			} else {
				$text = $this->handleCharRefs( $text, $pos );
			}
			$this->listener->characters( $text, 0, strlen( $text ), $pos, $length );
		}
	}
protected function emitDataRange( $pos, $length, $isSimple = false, $hasSimpleRefs = false ) {
		if ( $length === 0 ) {
			return;
		}
		if ( $this->ignoreCharRefs && $this->ignoreNulls && $this->ignoreErrors ) {
			// Pretend this data range doesn't contain < \0 or &
			$isSimple = true;
		}
		if ( $isSimple ) {
			$this->listener->characters( $this->text, $pos, $length, $pos, $length );
		} else {
			if ( !$this->ignoreErrors ) {
				// Any bare "<" in a data state text node is a parse error.
				// Uniquely to the data state, nulls are just flagged as errors
				// and passed through, they are not replaced.
				$this->handleAsciiErrors( "<\0", $this->text, $pos, $length, 0 );
			}

			$text = substr( $this->text, $pos, $length );
			if ( $hasSimpleRefs ) {
				$text = strtr( $text, self::$commonEntities );
			} else {
				$text = $this->handleCharRefs( $text, $pos );
			}
			$this->listener->characters( $text, 0, strlen( $text ), $pos, $length );
		}
	}
protected function emitDataRange ( $ pos , $ length , $ isSimple = false , $ hasSimpleRefs = false ) { if ( $ length === 0 ) { return ; } if ( $ this -> ignoreCharRefs && $ this -> ignoreNulls && $ this -> ignoreErrors ) { // Pretend this data range doesn't contain < \0 or & $ isSimple = true ; } if ( $ isSimple ) { $ this -> listener -> characters ( $ this -> text , $ pos , $ length , $ pos , $ length ) ; } else { if ( ! $ this -> ignoreErrors ) { // Any bare "<" in a data state text node is a parse error. // Uniquely to the data state, nulls are just flagged as errors // and passed through, they are not replaced. $ this -> handleAsciiErrors ( "<\0" , $ this -> text , $ pos , $ length , 0 ) ; } $ text = substr ( $ this -> text , $ pos , $ length ) ; if ( $ hasSimpleRefs ) { $ text = strtr ( $ text , self :: $ commonEntities ) ; } else { $ text = $ this -> handleCharRefs ( $ text , $ pos ) ; } $ this -> listener -> characters ( $ text , 0 , strlen ( $ text ) , $ pos , $ length ) ; } }
Emit a range of the input text as a character token, and emit related
errors, with validity rules as per the data state.

@param int $pos Offset within the input text
@param int $length The length of the range
@param bool $isSimple True if you know that the data range does not
contain < \0 or &; false is safe if you're not sure
@param bool $hasSimpleRefs True if you know that any character
references are semicolon terminated and in the list of $commonEntities;
false is safe if you're not sure
Emit a range of the input text as a character token and emit related errors with validity rules as per the data state .