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

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