Code Duplication    Length = 10-12 lines in 3 locations

Sources/ManageAttachments.php 3 locations

@@ 1221-1230 (lines=10) @@
1218
			$smcFunc['db_free_result']($result);
1219
1220
			// Do we need to delete what we have?
1221
			if ($fix_errors && !empty($to_remove) && in_array('missing_thumbnail_parent', $to_fix))
1222
				$smcFunc['db_query']('', '
1223
					DELETE FROM {db_prefix}attachments
1224
					WHERE id_attach IN ({array_int:to_remove})
1225
						AND attachment_type = {int:attachment_type}',
1226
					array(
1227
						'to_remove' => $to_remove,
1228
						'attachment_type' => 3,
1229
					)
1230
				);
1231
1232
			pauseAttachmentMaintenance($to_fix, $thumbnails);
1233
		}
@@ 1490-1501 (lines=12) @@
1487
			$smcFunc['db_free_result']($result);
1488
1489
			// Do we need to delete what we have?
1490
			if ($fix_errors && !empty($to_remove) && in_array('avatar_no_member', $to_fix))
1491
				$smcFunc['db_query']('', '
1492
					DELETE FROM {db_prefix}attachments
1493
					WHERE id_attach IN ({array_int:to_remove})
1494
						AND id_member != {int:no_member}
1495
						AND id_msg = {int:no_msg}',
1496
					array(
1497
						'to_remove' => $to_remove,
1498
						'no_member' => 0,
1499
						'no_msg' => 0,
1500
					)
1501
				);
1502
1503
			pauseAttachmentMaintenance($to_fix, $thumbnails);
1504
		}
@@ 1566-1577 (lines=12) @@
1563
			$smcFunc['db_free_result']($result);
1564
1565
			// Do we need to delete what we have?
1566
			if ($fix_errors && !empty($to_remove) && in_array('attachment_no_msg', $to_fix))
1567
				$smcFunc['db_query']('', '
1568
					DELETE FROM {db_prefix}attachments
1569
					WHERE id_attach IN ({array_int:to_remove})
1570
						AND id_member = {int:no_member}
1571
						AND attachment_type IN ({array_int:attach_thumb})',
1572
					array(
1573
						'to_remove' => $to_remove,
1574
						'no_member' => 0,
1575
						'attach_thumb' => array(0,3),
1576
					)
1577
				);
1578
1579
			pauseAttachmentMaintenance($to_fix, $thumbnails);
1580
		}