Code Duplication    Length = 5-5 lines in 2 locations

install/cli-install.php 1 location

@@ 1260-1264 (lines=5) @@
1257
                $rs = mysqli_query($sqlParser->conn,
1258
                    "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'");
1259
                $count_original_name = mysqli_num_rows($rs);
1260
                if ($overwrite == 'false') {
1261
                    $newname = $name . '-' . str_replace('.', '_', $modx_version);
1262
                    $rs = mysqli_query($sqlParser->conn,
1263
                        "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'");
1264
                    $count_new_name = mysqli_num_rows($rs);
1265
                }
1266
                $update = $count_original_name > 0 && $overwrite == 'true';
1267
                if ($update) {

install/src/controllers/install.php 1 location

@@ 443-447 (lines=5) @@
440
                $chunk = mysqli_real_escape_string($conn, $chunk);
441
                $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'");
442
                $count_original_name = mysqli_num_rows($rs);
443
                if($overwrite == 'false') {
444
                    $newname = $name . '-' . str_replace('.', '_', $modx_version);
445
                    $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'");
446
                    $count_new_name = mysqli_num_rows($rs);
447
                }
448
                $update = $count_original_name > 0 && $overwrite == 'true';
449
                if ($update) {
450
                    if (!mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {