Code Duplication    Length = 5-5 lines in 2 locations

manager/includes/src/Core.php 2 locations

@@ 4581-4585 (lines=5) @@
4578
            if ($tvsort != '') {
4579
                $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4580
            }
4581
            if ($tvidnames == "*") {
4582
                $query = "tv.id<>0";
4583
            } else {
4584
                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')";
4585
            }
4586
4587
            $this->getUserDocGroups();
4588
@@ 4749-4753 (lines=5) @@
4746
            $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
4747
            $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
4748
4749
            if ($idnames == '*') {
4750
                $query = 'tv.id<>0';
4751
            } else {
4752
                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')";
4753
            }
4754
4755
            $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv
4756
                    INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id