Code Duplication    Length = 13-13 lines in 4 locations

Sources/ScheduledTasks.php 4 locations

@@ 1337-1349 (lines=13) @@
1334
		if (!empty($modSettings['pruningOptions']) && strpos($modSettings['pruningOptions'], ',') !== false)
1335
			list ($modSettings['pruneErrorLog'], $modSettings['pruneModLog'], $modSettings['pruneBanLog'], $modSettings['pruneReportLog'], $modSettings['pruneScheduledTaskLog'], $modSettings['pruneSpiderHitLog']) = explode(',', $modSettings['pruningOptions']);
1336
1337
		if (!empty($modSettings['pruneErrorLog']))
1338
		{
1339
			// Figure out when our cutoff time is.  1 day = 86400 seconds.
1340
			$t = time() - $modSettings['pruneErrorLog'] * 86400;
1341
1342
			$smcFunc['db_query']('', '
1343
				DELETE FROM {db_prefix}log_errors
1344
				WHERE log_time < {int:log_time}',
1345
				array(
1346
					'log_time' => $t,
1347
				)
1348
			);
1349
		}
1350
1351
		if (!empty($modSettings['pruneModLog']))
1352
		{
@@ 1367-1379 (lines=13) @@
1364
			);
1365
		}
1366
1367
		if (!empty($modSettings['pruneBanLog']))
1368
		{
1369
			// Figure out when our cutoff time is.  1 day = 86400 seconds.
1370
			$t = time() - $modSettings['pruneBanLog'] * 86400;
1371
1372
			$smcFunc['db_query']('', '
1373
				DELETE FROM {db_prefix}log_banned
1374
				WHERE log_time < {int:log_time}',
1375
				array(
1376
					'log_time' => $t,
1377
				)
1378
			);
1379
		}
1380
1381
		if (!empty($modSettings['pruneReportLog']))
1382
		{
@@ 1427-1439 (lines=13) @@
1424
			}
1425
		}
1426
1427
		if (!empty($modSettings['pruneScheduledTaskLog']))
1428
		{
1429
			// Figure out when our cutoff time is.  1 day = 86400 seconds.
1430
			$t = time() - $modSettings['pruneScheduledTaskLog'] * 86400;
1431
1432
			$smcFunc['db_query']('', '
1433
				DELETE FROM {db_prefix}log_scheduled_tasks
1434
				WHERE time_run < {int:time_run}',
1435
				array(
1436
					'time_run' => $t,
1437
				)
1438
			);
1439
		}
1440
1441
		if (!empty($modSettings['pruneSpiderHitLog']))
1442
		{
@@ 1441-1453 (lines=13) @@
1438
			);
1439
		}
1440
1441
		if (!empty($modSettings['pruneSpiderHitLog']))
1442
		{
1443
			// Figure out when our cutoff time is.  1 day = 86400 seconds.
1444
			$t = time() - $modSettings['pruneSpiderHitLog'] * 86400;
1445
1446
			$smcFunc['db_query']('', '
1447
				DELETE FROM {db_prefix}log_spider_hits
1448
				WHERE log_time < {int:log_time}',
1449
				array(
1450
					'log_time' => $t,
1451
				)
1452
			);
1453
		}
1454
	}
1455
1456
	// Get rid of any paid subscriptions that were never actioned.