Code Duplication    Length = 3-4 lines in 2 locations

edit.php 1 location

@@ 16-18 (lines=3) @@
13
14
include_once __DIR__ . '/header.php';
15
16
foreach (['forum', 'topic_id', 'post_id', 'order'] as $getint) {
17
    ${$getint} = Request::getInt($getint, 0, 'GET');
18
}
19
20
if (!$topic_id && !$post_id) {
21
    $redirect = empty($forum) ? 'index.php' : "viewforum.php?forum={$forum}";

ratethread.php 1 location

@@ 39-42 (lines=4) @@
36
$ratinguser   = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
37
$anonwaitdays = 1;
38
$ip           = \Xmf\IPAddress::fromRequest()->asReadable();
39
foreach (['topic_id', 'rate', 'forum'] as $var) {
40
    //    ${$var} = isset($_POST[$var]) ? (int)($_POST[$var]) : (isset($_GET[$var])?(int)($_GET[$var]):0);
41
    ${$var} = Request::getInt($var, Request::getInt($var, 0, 'POST'), 'GET');
42
}
43
44
/** @var \NewbbTopicHandler $topicHandler */
45
$topicHandler = xoops_getModuleHandler('topic', 'newbb');