Code Duplication    Length = 3-3 lines in 5 locations

polls.php 5 locations

@@ 255-257 (lines=3) @@
252
        // old xoopspoll or umfrage or any clone from them
253
        if ($pollModuleHandler->getVar('version') < 140) {
254
            // check security token
255
            if (!$GLOBALS['xoopsSecurity']->check()) {
256
                redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 2, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
257
            }
258
            /*
259
             * The option check should be done before submitting
260
             */
@@ 338-340 (lines=3) @@
335
        // no break
336
    case 'update':
337
        // check security token
338
        if (!$GLOBALS['xoopsSecurity']->check()) {
339
            redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 2, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
340
        }
341
        /* make sure there's at least one option */
342
        $option_text   = Request::getString('option_text', '', 'POST');
343
        $option_string = is_array($option_text) ? implode('', $option_text) : $option_text;
@@ 542-544 (lines=3) @@
539
540
    case 'savemore':
541
        // check security token
542
        if (!$GLOBALS['xoopsSecurity']->check()) {
543
            redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 2, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
544
        }
545
546
        $option_text   = Request::getString('option_text', '', 'POST');
547
        $option_string = is_array($option_text) ? implode('', $option_text) : $option_text;
@@ 592-594 (lines=3) @@
589
590
    case 'delete_ok':
591
        // check security token
592
        if (!$GLOBALS['xoopsSecurity']->check()) {
593
            redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 2, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
594
        }
595
        //try and delete the poll
596
        // new xoopspoll module
597
        if ($pollModuleHandler->getVar('version') >= 140) {
@@ 675-677 (lines=3) @@
672
673
    case 'restart_ok':
674
        // check security token
675
        if (!$GLOBALS['xoopsSecurity']->check()) {
676
            redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 2, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
677
        }
678
679
        // new xoopspoll module
680
        if ($pollModuleHandler->getVar('version') >= 140) {