HTMLPurifier_Lexer::CDATACallback PHP Method

CDATACallback() protected static method

Callback function for escapeCDATA() that does the work.
protected static CDATACallback ( array $matches ) : string
$matches array PCRE matches array, with index 0 the entire match and 1 the inside of the CDATA section.
return string Escaped internals of the CDATA section.
    protected static function CDATACallback($matches)
    {
        // not exactly sure why the character set is needed, but whatever
        return htmlspecialchars($matches[1], ENT_COMPAT, 'UTF-8');
    }