Example #1
0
if ($action == 'doreply') {
    $reply = isset($_POST['reply']) ? trim(addslashes($_POST['reply'])) : '';
    $commentId = isset($_POST['cid']) ? intval($_POST['cid']) : '';
    $blogId = isset($_POST['gid']) ? intval($_POST['gid']) : '';
    $hide = isset($_POST['hide']) ? addslashes($_POST['hide']) : 'n';
    if ($reply == '') {
        emDirect("./comment.php?error_c=1");
    }
    if (strlen($reply) > 2000) {
        emDirect("./comment.php?error_d=1");
    }
    if (isset($_POST['pub_it'])) {
        $Comment_Model->showComment($commentId);
        $hide = 'n';
    }
    $Comment_Model->replyComment($blogId, $commentId, $reply, $hide);
    $CACHE->updateCache('comment');
    $CACHE->updateCache('sta');
    doAction('comment_reply', $commentId, $reply);
    emDirect("./comment.php?active_rep=1");
}
if ($action == 'doedit') {
    $name = isset($_POST['name']) ? addslashes(trim($_POST['name'])) : '';
    $mail = isset($_POST['mail']) ? addslashes(trim($_POST['mail'])) : '';
    $url = isset($_POST['url']) ? addslashes(trim($_POST['url'])) : '';
    $comment = isset($_POST['comment']) ? addslashes(trim($_POST['comment'])) : '';
    $commentId = isset($_POST['cid']) ? intval($_POST['cid']) : '';
    if ($comment == '') {
        emDirect("./comment.php?error_e=1");
    }
    if (strlen($comment) > 2000) {