Twitter_Autolink::__construct PHP Метод

__construct() публичный Метод

As the intent is to produce links and output the modified tweet to the user, we take this opportunity to ensure that we escape user input.
См. также: htmlspecialchars()
public __construct ( string $tweet, boolean $escape = true, boolean $full_encode = false )
$tweet string The tweet to be converted.
$escape boolean Whether to escape the tweet (default: true).
$full_encode boolean Whether to encode all special characters.
    public function __construct($tweet, $escape = true, $full_encode = false)
    {
        if ($escape) {
            if ($full_encode) {
                parent::__construct(htmlentities($tweet, ENT_QUOTES, 'UTF-8', false));
            } else {
                parent::__construct(htmlspecialchars($tweet, ENT_QUOTES, 'UTF-8', false));
            }
        } else {
            parent::__construct($tweet);
        }
    }