Code Duplication    Length = 13-13 lines in 2 locations

controller/comments.php 1 location

@@ 347-359 (lines=13) @@
344
345
        $error = array_map([$this->user, 'lang'], $error);
346
347
        if (!$this->user->data['is_registered'] && $this->config['dir_visual_confirm']) {
348
            $vc_response = $this->captcha->validate();
349
            if ($vc_response !== false) {
350
                $error[] = $vc_response;
351
            }
352
353
            if ($this->config['dir_visual_confirm_max_attempts'] && $this->captcha->get_attempt_count() > $this->config['dir_visual_confirm_max_attempts']) {
354
                $error[] = $this->user->lang['TOO_MANY_ADDS'];
355
            }
356
        }
357
358
        if (!$error) {
359
            $uid = $bitfield = $flags = '';
360
            generate_text_for_storage($this->s_comment, $uid, $bitfield, $flags, (bool) $this->config['dir_allow_bbcode'], (bool) $this->config['dir_allow_links'], (bool) $this->config['dir_allow_smilies']);
361
362
            $data_edit = [

controller/links.php 1 location

@@ 406-418 (lines=13) @@
403
            $error[] = $this->user->lang['DIR_ERROR_CHECK_URL'];
404
        }
405
406
        if (!$this->user->data['is_registered'] && $this->config['dir_visual_confirm']) {
407
            $vc_response = $this->captcha->validate($data);
408
            if ($vc_response !== false) {
409
                $error[] = $vc_response;
410
            }
411
412
            if ($this->config['dir_visual_confirm_max_attempts'] && $this->captcha->get_attempt_count() > $this->config['dir_visual_confirm_max_attempts']) {
413
                $error[] = $this->user->lang['TOO_MANY_ADDS'];
414
            }
415
        }
416
417
        if (!$error) {
418
            /*
419
            * No errrors, we execute heavy tasks wich need a valid url
420
            */
421