Code Duplication    Length = 5-5 lines in 2 locations

class/GwikiPage.php 2 locations

@@ 647-651 (lines=5) @@
644
        $prefix = $this->getPrefix($keyword);
645
        if ($prefix) {
646
            if ($prefix['defined']) {
647
                if (is_array($groups)) {
648
                    $groupwhere = ' IN (' . implode(', ', $groups) . ') ';
649
                } else {
650
                    $groupwhere = " = '" . $groups . "'";
651
                }
652
                $sql    = 'SELECT group_prefix_id FROM ' . $xoopsDB->prefix('gwiki_group_prefix') . ' WHERE prefix_id = \'' . $prefix['prefix_id'] . '\' AND group_id ' . $groupwhere;
653
                $result = $xoopsDB->query($sql);
654
                $rows   = $xoopsDB->getRowsNum($result);
@@ 736-740 (lines=5) @@
733
        $create_any = $gpermHandler->checkRight('wiki_authority', _MD_GWIKI_PAGE_PERM_CREATE_ANY_NUM, $groups, $module_id);
734
        $create_pfx = $gpermHandler->checkRight('wiki_authority', _MD_GWIKI_PAGE_PERM_CREATE_PFX_NUM, $groups, $module_id);
735
736
        if (is_array($groups)) {
737
            $groupwhere = ' IN (' . implode(', ', $groups) . ') ';
738
        } else {
739
            $groupwhere = " = '" . $groups . "'";
740
        }
741
742
        $sql = 'SELECT distinct p.prefix_id, prefix FROM ';
743
        $sql .= $xoopsDB->prefix('gwiki_prefix') . ' p, ';