Beispiel #1
0
/**
 * Callback for kses_split.
 *
 * @access private
 */
function _kses_split_callback($match)
{
    global $pass_allowed_html, $pass_allowed_protocols;
    return kses_split2($match[1], $pass_allowed_html, $pass_allowed_protocols);
}
function kses_split($string, $allowed_html, $allowed_protocols)
{
    // Required PHP >= 5.3.0
    $callback = function ($matches) use($allowed_html, $allowed_protocols) {
        return kses_split2($matches[1], $allowed_html, $allowed_protocols);
    };
    return preg_replace_callback('%(<' . '[^>]*' . '(>|$)' . '|>)%', $callback, $string);
}