Code Duplication    Length = 6-6 lines in 2 locations

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)

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

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