Code Duplication    Length = 5-6 lines in 2 locations

xoops_trust_path/libs/altsys/include/tpls_functions.php 2 locations

@@ 32-36 (lines=5) @@
29
30
    // UPDATE just tpl_lastmodified and tpl_source
31
    $drs = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset) . "' AND tpl_file='" . addslashes($tpl_file) . "'") ;
32
    while (list($tpl_id) = $db->fetchRow($drs)) {
33
        $db->queryF('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified='" . addslashes($lastmodified) . "',tpl_lastimported=UNIX_TIMESTAMP() WHERE tpl_id='$tpl_id'") ;
34
        $db->queryF('UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($tpl_source) . "' WHERE tpl_id='$tpl_id'") ;
35
        altsys_template_touch($tpl_id) ;
36
    }
37
38
    return true ;
39
}
@@ 115-120 (lines=6) @@
112
            $db->query('INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id='$tpl_id', tpl_source='" . addslashes($tpl_source) . "'") ;
113
            altsys_template_touch($tpl_id) ;
114
        } else {
115
            while (list($tpl_id) = $db->fetchRow($drs)) {
116
                // UPDATE mode
117
                $db->query('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified='" . addslashes($lastmodified) . "' WHERE tpl_id='$tpl_id'") ;
118
                $db->query('UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($tpl_source) . "' WHERE tpl_id='$tpl_id'") ;
119
                altsys_template_touch($tpl_id) ;
120
            }
121
        }
122
    }
123
}