/** * * Constructor. * * @param int $flags Flags for `htmlspecialchars()`. * * @param string $encoding The encoding to use for raw and escaped strings. * */ public function __construct($flags = null, $encoding = null) { if ($flags !== null) { // use custom flags only $this->setFlags($flags); } elseif (defined('ENT_SUBSTITUTE')) { // add ENT_SUBSTITUTE if available (PHP 5.4) $this->setFlags(ENT_QUOTES | ENT_SUBSTITUTE); } parent::__construct($encoding); }
/** * * Constructor. * * @param HtmlEscaper $html An HTML escaper. * * @param string $encoding The encoding to use for raw and escaped strings. * */ public function __construct(HtmlEscaper $html, $encoding = null) { $this->html = $html; parent::__construct($encoding); }