Code Duplication    Length = 6-7 lines in 2 locations

polls.php 2 locations

@@ 279-285 (lines=7) @@
276
            $pollObject->setVar('question', Request::getString('question', '', 'POST'));
277
            $pollObject->setVar('description', Request::getString('description', '', 'POST'));
278
            $end_time = Request::getString('end_time', '', 'POST'); // (empty($_POST['end_time'])) ? "" : $_POST['end_time'];
279
            if ('' !== $end_time) {
280
                $timezone = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('timezone') : null;
281
                $pollObject->setVar('end_time', userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone));
282
            } else {
283
                // if expiration date is not set, set it to 10 days from now
284
                $pollObject->setVar('end_time', time() + (86400 * 10));
285
            }
286
287
            $pollObject->setVar('display', 0);
288
            $pollObject->setVar('weight', Request::getInt('weight', 0, 'POST'));
@@ 685-690 (lines=6) @@
682
        }
683
684
        $end_time = !Request::getInt('end_time', 0, 'POST');
685
        if (0 !== $end_time) {
686
            $timezone = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('timezone') : null;
687
            $pollObject->setVar('end_time', userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone));
688
        } else {
689
            $pollObject->setVar('end_time', time() + $default_poll_duration);
690
        }
691
692
        $isNotify = Request::getInt('notify', 0, 'POST');
693
        if (!empty($isNotify) && ($end_time > time())) {