Code Duplication    Length = 5-5 lines in 2 locations

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';")) {

install/cli-install.php 1 location

@@ 1186-1190 (lines=5) @@
1183
                $chunk = mysqli_real_escape_string($conn, $chunk);
1184
                $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'");
1185
                $count_original_name = mysqli_num_rows($rs);
1186
                if($overwrite == 'false') {
1187
                    $newname = $name . '-' . str_replace('.', '_', $modx_version);
1188
                    $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'");
1189
                    $count_new_name = mysqli_num_rows($rs);
1190
                }
1191
                $update = $count_original_name > 0 && $overwrite == 'true';
1192
                if ($update) {
1193
                    if (!mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {