| @@ 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('', ''); |
|
| @@ 367-371 (lines=5) @@ | ||
| 364 | // Check captcha code if captcha_check enabled and user in not admin. |
|
| 365 | if ($this->use_captcha == TRUE AND $this->dx_auth->is_admin() == FALSE) { |
|
| 366 | ($hook = get_hook('comments_set_captcha')) ? eval($hook) : NULL; |
|
| 367 | if ($this->dx_auth->use_recaptcha) { |
|
| 368 | $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection'), 'trim|required|xss_clean|callback_captcha_check'); |
|
| 369 | } else { |
|
| 370 | $this->form_validation->set_rules('captcha', lang('Code protection'), 'trim|required|xss_clean|callback_captcha_check'); |
|
| 371 | } |
|
| 372 | } |
|
| 373 | ||
| 374 | $this->form_validation->set_rules('comment_text', lang('Comment', 'comments'), 'trim|required|xss_clean|max_length[' . $this->max_comment_length . ']'); |
|
| @@ 360-364 (lines=5) @@ | ||
| 357 | // Check captcha code if captcha_check enabled and user in not admin. |
|
| 358 | if ($this->use_captcha AND !$this->dx_auth->is_admin()) { |
|
| 359 | $this->form_validation->set_message('callback_captcha_check', lang('Wrong code protection', 'comments')); |
|
| 360 | if ($this->dx_auth->use_recaptcha) { |
|
| 361 | $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check'); |
|
| 362 | } else { |
|
| 363 | $this->form_validation->set_rules('captcha', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check'); |
|
| 364 | } |
|
| 365 | } |
|
| 366 | ||
| 367 | if ($this->max_comment_length != 0) { |
|
| @@ 481-485 (lines=5) @@ | ||
| 478 | if ($this->use_captcha == TRUE AND $this->dx_auth->is_admin() == FALSE) { |
|
| 479 | ($hook = get_hook('comments_set_captcha')) ? eval($hook) : NULL; |
|
| 480 | $this->form_validation->set_message('callback_captcha_check', lang('Wrong code protection', 'comments')); |
|
| 481 | if ($this->dx_auth->use_recaptcha) { |
|
| 482 | $this->form_validation->set_rules('recaptcha_response_field', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check'); |
|
| 483 | } else { |
|
| 484 | $this->form_validation->set_rules('captcha', lang('Code protection', 'comments'), 'trim|required|xss_clean|callback_captcha_check'); |
|
| 485 | } |
|
| 486 | } |
|
| 487 | ||
| 488 | if ($this->max_comment_length != 0) { |
|