Code Duplication    Length = 5-5 lines in 2 locations

install/cli-install.php 1 location

@@ 1170-1174 (lines=5) @@
1167
                $chunk = mysqli_real_escape_string($conn, $chunk);
1168
                $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'");
1169
                $count_original_name = mysqli_num_rows($rs);
1170
                if($overwrite == 'false') {
1171
                    $newname = $name . '-' . str_replace('.', '_', $modx_version);
1172
                    $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'");
1173
                    $count_new_name = mysqli_num_rows($rs);
1174
                }
1175
                $update = $count_original_name > 0 && $overwrite == 'true';
1176
                if ($update) {
1177
                    if (!mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {

install/instprocessor.php 1 location

@@ 460-464 (lines=5) @@
457
                $chunk = mysqli_real_escape_string($conn, $chunk);
458
                $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'");
459
                $count_original_name = mysqli_num_rows($rs);
460
                if($overwrite == 'false') {
461
                    $newname = $name . '-' . str_replace('.', '_', $modx_version);
462
                    $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'");
463
                    $count_new_name = mysqli_num_rows($rs);
464
                }
465
                $update = $count_original_name > 0 && $overwrite == 'true';
466
                if ($update) {
467
                    if (!mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {