Code Duplication    Length = 6-6 lines in 2 locations

install/cli-install.php 1 location

@@ 1098-1103 (lines=6) @@
1095
                    $template = mysqli_real_escape_string($conn, $assignment);
1096
                    $ts = mysqli_query($sqlParser->conn,
1097
                        "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$template';");
1098
                    if ($ds && $ts) {
1099
                        $tRow = mysqli_fetch_assoc($ts);
1100
                        $templateId = $tRow['id'];
1101
                        mysqli_query($sqlParser->conn,
1102
                            "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)");
1103
                    }
1104
                }
1105
            }
1106
        }

install/src/controllers/install.php 1 location

@@ 430-435 (lines=6) @@
427
                        $template = mysqli_real_escape_string($conn, $assignment);
428
                        $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$template';";
429
                        $ts = mysqli_query($sqlParser->conn, $query);
430
                        if ($ds && $ts) {
431
                            $tRow = mysqli_fetch_assoc($ts);
432
                            $templateId = $tRow['id'];
433
                            $query = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)";
434
                            mysqli_query($sqlParser->conn,$query);
435
                        }
436
                    }
437
                }
438
            }