Пример #1
0
function recaptcha_wp_saved_comment()
{
    if (!is_single() && !is_page()) {
        return;
    }
    if ($_GET['rcommentid'] && $_GET['rchash'] == recaptcha_wp_hash_comment($_GET['rcommentid'])) {
        $comment = get_comment($_GET['rcommentid']);
        echo "<script type='text/javascript'>\n\t\t\tvar _recaptcha_wordpress_savedcomment =  '" . rawurlencode(utf8_decode($comment->comment_content)) . "';\n\t\t\t_recaptcha_wordpress_savedcomment = unescape(_recaptcha_wordpress_savedcomment);\n\t\t      </script>";
        wp_delete_comment($comment->comment_ID);
    }
}
Пример #2
0
function recaptcha_wp_saved_comment()
{
    if (!is_single() && !is_page()) {
        return;
    }
    if ($_GET['rcommentid'] && $_GET['rchash'] == recaptcha_wp_hash_comment($_GET['rcommentid'])) {
        $comment = get_comment($_GET['rcommentid']);
        $com = preg_replace('/([\\/\\(\\)\\+\\;\'\\"])/e', '\'%\'.dechex(ord(\'$1\'))', $comment->comment_content);
        $com = preg_replace('/\\r\\n/m', '\\\\n', $com);
        echo "\n      <script type='text/javascript'>\n      var _recaptcha_wordpress_savedcomment =  '" . $com . "';\n\n      _recaptcha_wordpress_savedcomment = unescape(_recaptcha_wordpress_savedcomment);\n      </script>\n      ";
        wp_delete_comment($comment->comment_ID);
    }
}