Code Duplication    Length = 5-5 lines in 4 locations

application/modules/comments/comments.php 1 location

@@ 354-358 (lines=5) @@
351
        // Check captcha code if captcha_check enabled and user in not admin.
352
        if ($this->use_captcha == TRUE AND $this->dx_auth->is_admin() == FALSE) {
353
            ($hook = get_hook('comments_set_captcha')) ? eval($hook) : NULL;
354
            if ($this->dx_auth->use_recaptcha) {
355
                $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection'), 'trim|required|xss_clean|callback_captcha_check');
356
            } else {
357
                $this->form_validation->set_rules('captcha', lang('Code protection'), 'trim|required|xss_clean|callback_captcha_check');
358
            }
359
        }
360
361
        $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

@@ 339-343 (lines=5) @@
336
        // Check captcha code if captcha_check enabled and user in not admin.
337
        if ($this->use_captcha AND ! $this->dx_auth->is_admin()) {
338
            $this->form_validation->set_message('callback_captcha_check', lang('Wrong code protection', 'comments'));
339
            if ($this->dx_auth->use_recaptcha) {
340
                $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check');
341
            } else {
342
                $this->form_validation->set_rules('captcha', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check');
343
            }
344
        }
345
346
        if ($this->max_comment_length != 0) {
@@ 460-464 (lines=5) @@
457
        if ($this->use_captcha == TRUE AND $this->dx_auth->is_admin() == FALSE) {
458
            ($hook = get_hook('comments_set_captcha')) ? eval($hook) : NULL;
459
            $this->form_validation->set_message('callback_captcha_check', lang('Wrong code protection', 'comments'));
460
            if ($this->dx_auth->use_recaptcha) {
461
                $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check');
462
            } else {
463
                $this->form_validation->set_rules('captcha', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check');
464
            }
465
        }
466
467
        if ($this->max_comment_length != 0) {

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('', '');