Exemplo n.º 1
0
function SB_Replacer($parameters)
{
    if (isset($parameters['preview'])) {
        // preview mode
        $retval = '[## tags ##]';
        if (isset($parameters['text'])) {
            $retval = $parameters['text'];
        }
        return htmlspecialchars($retval);
    }
    if (!isset($parameters['text'])) {
        return '';
    }
    $text = $parameters['text'];
    handleTags($text);
    return $text;
}
Exemplo n.º 2
0
function removeAllTags($contents)
{
    handleTags($contents);
    $contents = preg_replace('/\\[#M_[^|]*\\|[^|]*\\|/Us', '', str_replace('_M#]', '', preg_replace('/\\[##_.+_##\\]/Us', '', $contents)));
    $contents = preg_replace('@<(s_[0-9a-zA-Z_]+)>.*?</\\1>@s', '', $contents);
    return $contents;
}