Code Duplication    Length = 6-6 lines in 2 locations

Apps/Model/Api/Comments/CommentAnswerAdd.php 1 location

@@ 55-60 (lines=6) @@
52
        }
53
54
        // guest moderation
55
        if (!App::$User->isAuth() && (bool)$this->_configs['guestModerate']) {
56
            $captcha = App::$Request->request->get('captcha');
57
            if (!App::$Captcha->validate($captcha)) {
58
                throw new JsonException(__('Captcha is incorrect! Click on image to refresh and try again'));
59
            }
60
        }
61
62
        // check if replayTo is defined
63
        if ($this->replayTo < 1) {

Apps/Model/Api/Comments/CommentPostAdd.php 1 location

@@ 79-84 (lines=6) @@
76
        }
77
78
        // guest moderation
79
        if (!App::$User->isAuth() && (bool)$this->_configs['guestModerate']) {
80
            $captcha = App::$Request->request->get('captcha');
81
            if (!App::$Captcha->validate($captcha)) {
82
                throw new JsonException(__('Captcha is incorrect! Click on image to refresh and try again'));
83
            }
84
        }
85
86
        // check delay between 2 comments from 1 user or 1 ip
87
        $query = CommentPost::where('user_id', '=', $this->_userId)