public function decode($str)
	{
		if ($this->decodeHtmlEntities && strpos($str, '&') !== false)
		{
			$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');
		}
		$str = str_replace("\x1A", '', $str);

		if ($this->hasEscapedChars)
		{
			$str = strtr(
				$str,
				[
					"\x1B0" => '!', "\x1B1" => '"', "\x1B2" => "'", "\x1B3" => '(',
					"\x1B4" => ')', "\x1B5" => '*', "\x1B6" => '[', "\x1B7" => '\\',
					"\x1B8" => ']', "\x1B9" => '^', "\x1BA" => '_', "\x1BB" => '`',
					"\x1BC" => '~'
				]
			);
		}

		return $str;
	}
public function decode($str)
	{
		if ($this->decodeHtmlEntities && strpos($str, '&') !== false)
		{
			$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');
		}
		$str = str_replace("\x1A", '', $str);

		if ($this->hasEscapedChars)
		{
			$str = strtr(
				$str,
				[
					"\x1B0" => '!', "\x1B1" => '"', "\x1B2" => "'", "\x1B3" => '(',
					"\x1B4" => ')', "\x1B5" => '*', "\x1B6" => '[', "\x1B7" => '\\',
					"\x1B8" => ']', "\x1B9" => '^', "\x1BA" => '_', "\x1BB" => '`',
					"\x1BC" => '~'
				]
			);
		}

		return $str;
	}
public function decode ( $ str ) { if ( $ this -> decodeHtmlEntities && strpos ( $ str , '&' ) !== false ) { $ str = html_entity_decode ( $ str , ENT_QUOTES , 'UTF-8' ) ; } $ str = str_replace ( "\x1A" , '' , $ str ) ; if ( $ this -> hasEscapedChars ) { $ str = strtr ( $ str , [ "\x1B0" => '!' , "\x1B1" => '"' , "\x1B2" => "'" , "\x1B3" => '(' , "\x1B4" => ')' , "\x1B5" => '*' , "\x1B6" => '[' , "\x1B7" => '\\' , "\x1B8" => ']' , "\x1B9" => '^' , "\x1BA" => '_' , "\x1BB" => '`' , "\x1BC" => '~' ] ) ; } return $ str ; }
Decode a chunk of encoded text to be used as an attribute value

Decodes escaped literals and removes slashes and 0x1A characters

@param  string $str Encoded text
@return string      Decoded text
Decode a chunk of encoded text to be used as an attribute value