Code Duplication    Length = 13-13 lines in 4 locations

Sources/ScheduledTasks.php 4 locations

@@ 1324-1336 (lines=13) @@
1321
		if (!empty($modSettings['pruningOptions']) && strpos($modSettings['pruningOptions'], ',') !== false)
1322
			list ($modSettings['pruneErrorLog'], $modSettings['pruneModLog'], $modSettings['pruneBanLog'], $modSettings['pruneReportLog'], $modSettings['pruneScheduledTaskLog'], $modSettings['pruneSpiderHitLog']) = explode(',', $modSettings['pruningOptions']);
1323
1324
		if (!empty($modSettings['pruneErrorLog']))
1325
		{
1326
			// Figure out when our cutoff time is.  1 day = 86400 seconds.
1327
			$t = time() - $modSettings['pruneErrorLog'] * 86400;
1328
1329
			$smcFunc['db_query']('', '
1330
				DELETE FROM {db_prefix}log_errors
1331
				WHERE log_time < {int:log_time}',
1332
				array(
1333
					'log_time' => $t,
1334
				)
1335
			);
1336
		}
1337
1338
		if (!empty($modSettings['pruneModLog']))
1339
		{
@@ 1354-1366 (lines=13) @@
1351
			);
1352
		}
1353
1354
		if (!empty($modSettings['pruneBanLog']))
1355
		{
1356
			// Figure out when our cutoff time is.  1 day = 86400 seconds.
1357
			$t = time() - $modSettings['pruneBanLog'] * 86400;
1358
1359
			$smcFunc['db_query']('', '
1360
				DELETE FROM {db_prefix}log_banned
1361
				WHERE log_time < {int:log_time}',
1362
				array(
1363
					'log_time' => $t,
1364
				)
1365
			);
1366
		}
1367
1368
		if (!empty($modSettings['pruneReportLog']))
1369
		{
@@ 1414-1426 (lines=13) @@
1411
			}
1412
		}
1413
1414
		if (!empty($modSettings['pruneScheduledTaskLog']))
1415
		{
1416
			// Figure out when our cutoff time is.  1 day = 86400 seconds.
1417
			$t = time() - $modSettings['pruneScheduledTaskLog'] * 86400;
1418
1419
			$smcFunc['db_query']('', '
1420
				DELETE FROM {db_prefix}log_scheduled_tasks
1421
				WHERE time_run < {int:time_run}',
1422
				array(
1423
					'time_run' => $t,
1424
				)
1425
			);
1426
		}
1427
1428
		if (!empty($modSettings['pruneSpiderHitLog']))
1429
		{
@@ 1428-1440 (lines=13) @@
1425
			);
1426
		}
1427
1428
		if (!empty($modSettings['pruneSpiderHitLog']))
1429
		{
1430
			// Figure out when our cutoff time is.  1 day = 86400 seconds.
1431
			$t = time() - $modSettings['pruneSpiderHitLog'] * 86400;
1432
1433
			$smcFunc['db_query']('', '
1434
				DELETE FROM {db_prefix}log_spider_hits
1435
				WHERE log_time < {int:log_time}',
1436
				array(
1437
					'log_time' => $t,
1438
				)
1439
			);
1440
		}
1441
	}
1442
1443
	// Get rid of any paid subscriptions that were never actioned.