Code Duplication    Length = 6-6 lines in 2 locations

blocks/xoopsfaq_rand.php 1 location

@@ 55-60 (lines=6) @@
52
    // Filter out cats based on group permissions
53
    $options[1] = isset($options[1]) ? $options[1] : [0];
54
    $cTu        = $catsToUse = (false === strpos($options[1], ',')) ? (array)$options[1] : explode(',', $options[1]);
55
    if (in_array(0, $catsToUse) || empty($catsToUse)) {
56
        // Get a list of all cats
57
        $categoryHandler = $helper->getHandler('Category');
58
        $catListArray    = $categoryHandler->getList();
59
        $cTu             = $catsToUse = array_keys($catListArray);
60
    }
61
    // Remove any cats this user doesn't have rights to view
62
    foreach ($cTu as $key => $thisCat) {
63
        if (false === $permHelper->checkPermission('viewcat', $thisCat)) {

blocks/xoopsfaq_recent.php 1 location

@@ 60-65 (lines=6) @@
57
58
    $options[3] = isset($options[3]) ? $options[3] : [0];
59
    $cTu        = $catsToUse = (false === strpos($options[3], ',')) ? (array)$options[3] : explode(',', $options[3]);
60
    if (in_array(0, $catsToUse) || empty($catsToUse)) {
61
        // Get a list of all cats
62
        $categoryHandler = $helper->getHandler('Category');
63
        $catListArray    = $categoryHandler->getList();
64
        $cTu             = $catsToUse = array_keys($catListArray);
65
    }
66
    // Remove any cats this user doesn't have rights to view
67
    foreach ($cTu as $key => $thisCat) {
68
        if (false === $permHelper->checkPermission('viewcat', $thisCat)) {