Example #1
0
/**
 * Removes the signature and edit message from a message
 * @param $row Message passed by reference
 */
function phorum_htmlpurifier_remove_sig_and_editmessage(&$row)
{
    $signature = phorum_htmlpurifier_generate_sig($row);
    $editmessage = phorum_htmlpurifier_generate_editmessage($row);
    $replacements = array();
    // we need to remove add <phorum break> as that is the form these
    // extra bits are in.
    if ($signature) {
        $replacements[str_replace("\n", "<phorum break>\n", $signature)] = '';
    }
    if ($editmessage) {
        $replacements[str_replace("\n", "<phorum break>\n", $editmessage)] = '';
    }
    $row['body'] = strtr($row['body'], $replacements);
    return array($signature, $editmessage);
}
Example #2
0
/**
 * Removes the signature and edit message from a message
 * @param $row Message passed by reference
 */
function phorum_htmlpurifier_remove_sig_and_editmessage(&$row)
{
    // attempt to remove the Phorum's pre-processing:
    // we must not process the signature or editmessage
    $signature = phorum_htmlpurifier_generate_sig($row);
    $editmessage = phorum_htmlpurifier_generate_editmessage($row);
    $row['body'] = strtr($row['body'], array($signature => '', $editmessage => ''));
    return array($signature, $editmessage);
}