Code Duplication    Length = 5-5 lines in 4 locations

application/modules/feedback/feedback.php 1 location

@@ 86-90 (lines=5) @@
83
            $this->form_validation->set_rules('theme', lang('Subject', 'feedback'), 'trim|max_length[' . $this->theme_max_len . ']|xss_clean');
84
            $this->form_validation->set_rules('message', lang('Message', 'feedback'), 'trim|required|max_length[' . $this->message_max_len . ']|xss_clean');
85
86
            if ($this->dx_auth->use_recaptcha) {
87
                $this->form_validation->set_rules('recaptcha_response_field', lang('Protection code', 'feedback'), 'trim|xss_clean|required|callback_recaptcha_check');
88
            } else {
89
                $this->form_validation->set_rules('captcha', lang('Protection code', 'feedback'), 'trim|required|xss_clean|callback_captcha_check');
90
            }
91
92
            if ($this->form_validation->run($this) == FALSE) { // there are errors
93
                $this->form_validation->set_error_delimiters('', '');

application/modules/comments/comments.php 1 location

@@ 358-362 (lines=5) @@
355
        // Check captcha code if captcha_check enabled and user in not admin.
356
        if ($this->use_captcha == TRUE AND $this->dx_auth->is_admin() == FALSE) {
357
            ($hook = get_hook('comments_set_captcha')) ? eval($hook) : NULL;
358
            if ($this->dx_auth->use_recaptcha) {
359
                $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection'), 'trim|required|xss_clean|callback_captcha_check');
360
            } else {
361
                $this->form_validation->set_rules('captcha', lang('Code protection'), 'trim|required|xss_clean|callback_captcha_check');
362
            }
363
        }
364
365
        $this->form_validation->set_rules('comment_text', lang('Comment', 'comments'), 'trim|required|xss_clean|max_length[' . $this->max_comment_length . ']');

application/modules/comments/commentsapi.php 2 locations

@@ 346-350 (lines=5) @@
343
        // Check captcha code if captcha_check enabled and user in not admin.
344
        if ($this->use_captcha AND ! $this->dx_auth->is_admin()) {
345
            $this->form_validation->set_message('callback_captcha_check', lang('Wrong code protection', 'comments'));
346
            if ($this->dx_auth->use_recaptcha) {
347
                $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check');
348
            } else {
349
                $this->form_validation->set_rules('captcha', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check');
350
            }
351
        }
352
353
        if ($this->max_comment_length != 0) {
@@ 467-471 (lines=5) @@
464
        if ($this->use_captcha == TRUE AND $this->dx_auth->is_admin() == FALSE) {
465
            ($hook = get_hook('comments_set_captcha')) ? eval($hook) : NULL;
466
            $this->form_validation->set_message('callback_captcha_check', lang('Wrong code protection', 'comments'));
467
            if ($this->dx_auth->use_recaptcha) {
468
                $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check');
469
            } else {
470
                $this->form_validation->set_rules('captcha', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check');
471
            }
472
        }
473
474
        if ($this->max_comment_length != 0) {